Skip to content

Commit

Permalink
CONCD-955 numbers don't look correct (#2545)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasarkar authored Sep 26, 2024
1 parent f380254 commit e890e73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions concordia/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,9 @@ def review_incidents(self):
user = ConcordiaUser.objects.get(id=user_id)
incident_count = user.review_incidents(recent_accepts, recent_rejects)
if incident_count > 0:
review_count = Transcription.objects.filter(reviewed_by=user).count()
user_incident_count.append(
(user.id, user.username, incident_count, user.profile.review_count)
(user.id, user.username, incident_count, review_count)
)

return user_incident_count
Expand All @@ -883,12 +884,13 @@ def transcribe_incidents(self):
user = ConcordiaUser.objects.get(id=user_id)
incident_count = user.transcribe_incidents(transcriptions)
if incident_count > 0:
transcribe_count = Transcription.objects.filter(user=user).count()
user_incident_count.append(
(
user.id,
user.username,
incident_count,
user.profile.transcribe_count,
transcribe_count,
)
)

Expand Down
8 changes: 4 additions & 4 deletions concordia/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_review_incidents(self):
self.transcription1.reviewed_by.id,
self.transcription1.reviewed_by.username,
1,
2,
4,
),
)

Expand All @@ -170,7 +170,7 @@ def test_review_incidents(self):
self.transcription1.reviewed_by.id,
self.transcription1.reviewed_by.username,
2,
2,
6,
),
)

Expand Down Expand Up @@ -205,7 +205,7 @@ def test_transcribe_incidents(self):
self.assertEqual(len(users), 1)
self.assertEqual(
users[0],
(self.transcription1.user.id, self.transcription1.user.username, 1, 4),
(self.transcription1.user.id, self.transcription1.user.username, 1, 5),
)

create_transcription(
Expand All @@ -217,7 +217,7 @@ def test_transcribe_incidents(self):
self.assertEqual(len(users), 1)
self.assertEqual(
users[0],
(self.transcription1.user.id, self.transcription1.user.username, 2, 5),
(self.transcription1.user.id, self.transcription1.user.username, 2, 6),
)


Expand Down

0 comments on commit e890e73

Please sign in to comment.