Skip to content

Commit

Permalink
added minor changes for labeled ann
Browse files Browse the repository at this point in the history
  • Loading branch information
KunalTiwary committed Dec 12, 2024
1 parent ead6025 commit deb0592
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions backend/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
)
Expand Down

0 comments on commit deb0592

Please sign in to comment.