Skip to content

Commit 30f9bb6

Browse files
authored
Merge pull request #789 from superannotateai/fix_set_steps
fix in set_project_steps
2 parents 35fbaab + 1b89781 commit 30f9bb6

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

src/superannotate/lib/core/usecases/projects.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -738,18 +738,20 @@ def execute(self):
738738
step_setting = next(
739739
(i for i in project_settings if i.attribute == "WorkflowType"), None
740740
)
741-
if (
742-
self._connections is not None
743-
and step_setting.value == constants.StepsType.BASIC.value
744-
):
745-
raise AppException("Can't update steps type. ")
746-
747-
if step_setting.value == constants.StepsType.BASIC:
741+
if self._connections is None and step_setting.value in [
742+
constants.StepsType.INITIAL.value,
743+
constants.StepsType.BASIC.value,
744+
]:
748745
self.set_basic_steps(annotation_classes)
749-
else:
746+
elif self._connections is not None and step_setting.value in [
747+
constants.StepsType.INITIAL.value,
748+
constants.StepsType.KEYPOINT.value,
749+
]:
750750
self.set_keypoint_steps(
751751
annotation_classes, self._steps, self._connections
752752
)
753+
else:
754+
raise AppException("Can't update steps type.")
753755

754756
return self._response
755757

tests/integration/annotations/test_upload_annotations.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import os
33
import tempfile
4-
import time
54
from pathlib import Path
65

76
from src.superannotate import AppException

tests/integration/items/test_item_context.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import json
22
import os
3-
import time
43
from pathlib import Path
54

65
from src.superannotate import FileChangedError
@@ -54,7 +53,7 @@ def _base_test(self, path, item):
5453
assert ic.get_component_value("component_id_1") is None
5554
ic.set_component_value("component_id_1", "value")
5655
with self.assertRaisesRegexp(
57-
FileChangedError, "The file has changed and overwrite is set to False."
56+
FileChangedError, "The file has changed and overwrite is set to False."
5857
):
5958
with sa.item_context(path, item, overwrite=False) as ic:
6059
assert ic.get_component_value("component_id_1") == "value"
@@ -108,7 +107,7 @@ def setUp(self, *args, **kwargs):
108107
)
109108
team = sa.controller.team
110109
project = sa.controller.get_project(self.PROJECT_NAME)
111-
# time.sleep(10)
110+
# time.sleep(10)
112111
with open(self.EDITOR_TEMPLATE_PATH) as f:
113112
res = sa.controller.service_provider.projects.attach_editor_template(
114113
team, project, template=json.load(f)

tests/integration/items/test_list_items.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import random
44
import string
5-
import time
65
from pathlib import Path
76

87
from src.superannotate import AppException

0 commit comments

Comments
 (0)