Skip to content

Commit 03b5448

Browse files
committed
Update __init__.py
1 parent b77143d commit 03b5448

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
55
;pytest_plugins = ['pytest_profiling']
6-
addopts = -n auto --dist=loadscope
6+
;addopts = -n auto --dist=loadscope

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import sys
33

4-
__version__ = "4.4.2dev2"
4+
__version__ = "4.4.2dev3"
55

66
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
77

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)