Skip to content

Commit

Permalink
re moved annotations.json, formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mesemus committed Nov 21, 2024
1 parent 85f8872 commit e548b83
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 358 deletions.
348 changes: 0 additions & 348 deletions annotations.json

This file was deleted.

20 changes: 13 additions & 7 deletions oarepo_workflows/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,23 +218,29 @@ def get_workflow(self, record: Record | dict) -> Workflow:
try:
parent = record.parent # noqa for typing: we do not have a better type for record with parent
except AttributeError as e:
raise MissingWorkflowError("Record does not have a parent attribute, is it a draft-enabled record?",
record=record) from e
raise MissingWorkflowError(
"Record does not have a parent attribute, is it a draft-enabled record?",
record=record,
) from e
try:
workflow_id = parent.workflow
except AttributeError as e:
raise MissingWorkflowError("Parent record does not have a workflow attribute.",
record=record) from e
raise MissingWorkflowError(
"Parent record does not have a workflow attribute.", record=record
) from e
else:
try:
parent = record["parent"]
except KeyError as e:
raise MissingWorkflowError("Record does not have a parent attribute.",
record=record) from e
raise MissingWorkflowError(
"Record does not have a parent attribute.", record=record
) from e
try:
workflow_id = parent["workflow"]
except KeyError as e:
raise MissingWorkflowError("Parent record does not have a workflow attribute.", record=record) from e
raise MissingWorkflowError(
"Parent record does not have a workflow attribute.", record=record
) from e

try:
return self.record_workflows[workflow_id]
Expand Down
Loading

0 comments on commit e548b83

Please sign in to comment.