From 79dd516cc51fb9e8b6ec8b02a13f57095640281b Mon Sep 17 00:00:00 2001 From: Vinay Augustine Date: Sun, 2 Jun 2019 08:44:23 -0400 Subject: [PATCH] Make progress bar only show annotations for the current user. --- app/server/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/server/api.py b/app/server/api.py index bc853c4d..07b289e1 100644 --- a/app/server/api.py +++ b/app/server/api.py @@ -67,7 +67,8 @@ class StatisticsAPI(APIView): docs = project.documents annotation_class = project.get_annotation_class() total = docs.count() - done = annotation_class.objects.filter(document_id__in=docs.all()).\ + done = annotation_class.objects.filter(document_id__in=docs.all(), + user_id=self.request.user).\ aggregate(Count('document', distinct=True))['document__count'] remaining = total - done return {'total': total, 'remaining': remaining}