-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Describe the bug
gate-teamware/backend/models.py
Lines 852 to 858 in 57946de
| @property | |
| def num_annotations(self): | |
| """Number of annotations completed by this annotator in this project""" | |
| count = 0 | |
| for d in self.project.documents.filter(doc_type=DocumentType.ANNOTATION): | |
| count += d.annotations.filter(user=self.annotator).count() | |
| return count |
The comment on this property (of the AnnotatorProject join-table class) suggests that it is supposed to count the number of completed annotations for the given user on the given project, but it actually counts all Annotation objects in the project that reference the user, including those that are rejected, timed-out or pending. Since a timed-out document can be issued to the same user again later in their annotation cycle, this can lead to the situation where the UI suggests the user has annotated more documents than are available in the project:
Expected behavior
The total should only count completed documents (or possibly completed and rejected), not timed out or pending (in progress).
