@@ -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