Skip to content

Commit

Permalink
Fix incorrect computation for task progress
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max committed May 1, 2023
1 parent 40620e9 commit ba5a926
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cvat/apps/engine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from django.db import IntegrityError
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseBadRequest
from django.utils import timezone
import django.db.models as dj_models
from django.db.models import Count, Q

from drf_spectacular.types import OpenApiTypes
Expand Down Expand Up @@ -670,9 +669,10 @@ class TaskViewSet(viewsets.GenericViewSet, mixins.ListModelMixin,
'label_set__sublabels__attributespec_set',
'project__label_set__sublabels__attributespec_set'
).annotate(
completed_jobs_count=dj_models.Count(
completed_jobs_count=Count(
'segment__job',
filter=dj_models.Q(segment__job__state=models.StateChoice.COMPLETED.value)
filter=Q(segment__job__state=models.StateChoice.COMPLETED.value),
distinct=True
),
task_labels_count=Count('label',
filter=Q(label__parent__isnull=True), distinct=True),
Expand Down

0 comments on commit ba5a926

Please sign in to comment.