Skip to content

Commit 23d4629

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
CLI fix
1 parent 9c988f5 commit 23d4629

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/superannotate/lib/app/interface/cli_interface.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from pathlib import Path
1212
from typing import Any
1313
from typing import Optional
14-
from tqdm import tqdm
1514

1615
import lib.core as constances
1716
import pandas as pd

src/superannotate/lib/core/usecases.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,22 @@ def work_flow_use_case(self):
19381938
)
19391939

19401940
def execute(self):
1941-
data = {"project": self._projects.get_one(uuid=self._project.uuid,team_id=self._project.team_id) }
1941+
data = {}
1942+
project = self._projects.get_one(
1943+
uuid=self._project.uuid, team_id=self._project.team_id
1944+
)
1945+
if self._include_complete_image_count:
1946+
projects = self._projects.get_all(
1947+
condition=(
1948+
Condition("completeImagesCount", "true", EQ)
1949+
& Condition("name", self._project.name, EQ)
1950+
& Condition("team_id", self._project.team_id, EQ)
1951+
)
1952+
)
1953+
if projects:
1954+
data["project"] = projects[0]
1955+
else:
1956+
data["project"] = project
19421957

19431958
if self._include_annotation_classes:
19441959
self.annotation_classes_use_case.execute()
@@ -1953,18 +1968,7 @@ def execute(self):
19531968
data["workflows"] = self.work_flow_use_case.execute().data
19541969

19551970
if self._include_contributors:
1956-
data["contributors"] = self._project.users
1957-
1958-
if self._include_complete_image_count:
1959-
projects = self._projects.get_all(
1960-
condition=(
1961-
Condition("completeImagesCount", "true", EQ)
1962-
& Condition("name", self._project.name, EQ)
1963-
& Condition("team_id", self._project.team_id, EQ)
1964-
)
1965-
)
1966-
if projects:
1967-
data["project"] = projects[0]
1971+
data["contributors"] = project.users
19681972

19691973
self._response.data = data
19701974
return self._response

0 commit comments

Comments
 (0)