@@ -183,7 +183,7 @@ def prepare_annotation(self, annotation: dict) -> dict:
183183 raise AppException (errors )
184184
185185 annotation = UploadAnnotationUseCase .set_defaults (
186- annotation , self ._project .type
186+ self . _team . creator_id , annotation , self ._project .type
187187 )
188188 return annotation
189189
@@ -580,8 +580,12 @@ def _validate_json(self, json_data: dict) -> list:
580580 return use_case .execute ().data
581581
582582 @staticmethod
583- def set_defaults (annotation_data : dict , project_type : int ):
583+ def set_defaults (team_id , annotation_data : dict , project_type : int ):
584584 default_data = {}
585+ annotation_data ["metadata" ]["lastAction" ] = {
586+ "email" : team_id ,
587+ "timestamp" : int (time .time ())
588+ }
585589 instances = annotation_data .get ("instances" , [])
586590 if project_type in constants .ProjectType .images :
587591 default_data ["probability" ] = 100
@@ -606,7 +610,9 @@ def execute(self):
606610 if self .is_valid ():
607611 annotation_json , mask = self ._get_annotation_json ()
608612 errors = self ._validate_json (annotation_json )
609- annotation_json = self .set_defaults (annotation_json , self ._project .type )
613+ annotation_json = UploadAnnotationUseCase .set_defaults (
614+ self ._team .creator_id , annotation_json , self ._project .type
615+ )
610616 if not errors :
611617 annotation_file = io .StringIO ()
612618 json .dump (annotation_json , annotation_file )
0 commit comments