Skip to content

Commit bd26bf5

Browse files
committed
fix project validations on create annotation classes
1 parent 732460b commit bd26bf5

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

src/superannotate/lib/core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from pathlib import Path
22

3-
from superannotate.lib.core.enums import ProjectStatus
43
from superannotate.lib.core.enums import AnnotationStatus
54
from superannotate.lib.core.enums import ImageQuality
5+
from superannotate.lib.core.enums import ProjectStatus
66
from superannotate.lib.core.enums import ProjectType
77
from superannotate.lib.core.enums import SegmentationStatus
88
from superannotate.lib.core.enums import TrainingStatus

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,7 +2732,7 @@ def validate_uniqueness(self):
27322732

27332733
def validate_project_type(self):
27342734
if (
2735-
self._project.project_type != ProjectType.VECTOR.value
2735+
self._project.project_type in (ProjectType.PIXEL.value and ProjectType.VIDEO.value)
27362736
and self._annotation_class.type == "tag"
27372737
):
27382738
raise AppException(
@@ -2846,9 +2846,9 @@ def __init__(
28462846
self._project = project
28472847

28482848
def validate_project_type(self):
2849-
if self._project.project_type != ProjectType.VECTOR.value and "tag" in [
2850-
i.type for i in self._annotation_classes
2851-
]:
2849+
if self._project.project_type in (ProjectType.PIXEL.value, ProjectType.VIDEO.value) and "tag" in any([
2850+
True for i in self._annotation_classes if i.type == "tag"
2851+
]):
28522852
raise AppException(
28532853
f"Predefined tagging functionality is not supported for projects of type {ProjectType.get_name(self._project.project_type)}."
28542854
)

src/superannotate/lib/infrastructure/services.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import asyncio
22
import json
3-
import time
43
from contextlib import contextmanager
54
from datetime import datetime
65
from typing import Dict

tests/integration/projects/test_create_project_from_metadata.py

Whitespace-only changes.

0 commit comments

Comments
 (0)