Skip to content

Commit

Permalink
Update project's on save annotations (#7808)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Apr 26, 2024
1 parent 734e748 commit 4f51704
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog.d/20240426_132420_boris_fixed_project_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Project's `updated_date` was not updated after changing annotations in jobs
(<https://github.com/cvat-ai/cvat/pull/7808>)
9 changes: 7 additions & 2 deletions cvat/apps/dataset_manager/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def add_prefetch_info(cls, queryset):
'segment',
'segment__task',
).prefetch_related(
'segment__task__project',
'segment__task__owner',
'segment__task__assignee',
'segment__task__project__owner',
Expand Down Expand Up @@ -388,8 +389,12 @@ def _save_tags_to_db(self, tags):
self.ir_data.tags = tags

def _set_updated_date(self):
self.db_job.segment.task.touch()
self.db_job.touch()
db_task = self.db_job.segment.task
with transaction.atomic():
self.db_job.touch()
db_task.touch()
if db_project := db_task.project:
db_project.touch()

@staticmethod
def _data_is_empty(data):
Expand Down

0 comments on commit 4f51704

Please sign in to comment.