From deb0592f7fafbf54aaaeea28542907073348b0b6 Mon Sep 17 00:00:00 2001 From: Kunal Tiwary Date: Thu, 12 Dec 2024 05:54:47 +0000 Subject: [PATCH] added minor changes for labeled ann --- backend/projects/views.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/projects/views.py b/backend/projects/views.py index 73bc2628..1bb38b9f 100644 --- a/backend/projects/views.py +++ b/backend/projects/views.py @@ -1966,6 +1966,13 @@ def assign_new_tasks(self, request, pk, *args, **kwargs): project.max_tasks_per_user - tasks_assigned_to_user, tasks_to_be_assigned, ) + proj_annotations_annotated = Annotation_model.objects.filter( + task__project_id=pk + ).filter( + annotation_status__in=[UNLABELED, SKIPPED, DRAFT, LABELED, TO_BE_REVISED], + completed_by=cur_user, + annotation_type=1, + ) ( data_items_of_unassigned_tasks, data_items_of_assigned_tasks, @@ -1977,6 +1984,8 @@ def assign_new_tasks(self, request, pk, *args, **kwargs): data_items_of_unassigned_tasks.add(t.input_data.id) for anno in proj_annotations: data_items_of_assigned_tasks.add(anno.task.input_data.id) + for anno_ann in proj_annotations_annotated: + data_items_of_assigned_tasks.add(anno_ann.task.input_data.id) all_unassigned_data_items = ( data_items_of_unassigned_tasks - data_items_of_assigned_tasks )