Skip to content

Commit ad3fed7

Browse files
committed
Fix attribute ID in set_project_workflow
1 parent 8f76ab1 commit ad3fed7

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

superannotate/db/projects.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,9 @@ def set_project_workflow(project, new_workflow):
18761876
"""Sets project's workflow.
18771877
18781878
new_workflow example: [{ "step" : <step_num>, "className" : <annotation_class>, "tool" : <tool_num>,
1879-
"attribute":[{"attribute" : {"name" : <attribute_value>, "attribute_group" : {"name": <attribute_group>}}},...]},...]
1879+
"attribute":[{"attribute" : {"name" : <attribute_value>, "attribute_group" : {"name": <attribute_group>}}},
1880+
...]
1881+
},...]
18801882
18811883
:param project: project name or metadata
18821884
:type project: str or dict
@@ -1922,9 +1924,15 @@ def set_project_workflow(project, new_workflow):
19221924
response.status_code,
19231925
"Couldn't set project workflow " + response.text
19241926
)
1925-
workflow_id = response.json()[0]["id"]
19261927
if "attribute" not in step:
19271928
continue
1929+
current_steps = get_project_workflow(project)
1930+
for step_in_response in current_steps:
1931+
if step_in_response["step"] == step["step"]:
1932+
workflow_id = step_in_response["id"]
1933+
break
1934+
else:
1935+
raise SABaseException(0, "Couldn't find step in workflow")
19281936
request_data = []
19291937
for attribute in step["attribute"]:
19301938
for att_class in an_class["attribute_groups"]:

superannotate/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.2.3"
1+
__version__ = "3.2.4"

0 commit comments

Comments
 (0)