From c5571c01e2ae46db04cd64a28c3b431ee5bb160e Mon Sep 17 00:00:00 2001 From: Alexander Wu Date: Sun, 5 Apr 2020 17:31:12 -0700 Subject: [PATCH] Fix count of officer challenges on candidate portal --- hknweb/candidate/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hknweb/candidate/views.py b/hknweb/candidate/views.py index 9022f49c..1470fbdb 100644 --- a/hknweb/candidate/views.py +++ b/hknweb/candidate/views.py @@ -44,13 +44,13 @@ def get_context_data(self): challenges = OffChallenge.objects \ .filter(requester__exact=self.request.user) # if either one is waiting, challenge is still being reviewed - num_pending = challenges \ - .filter(Q(officer_confirmed__isnull=True) | Q(csec_confirmed__isnull=True)) \ + num_confirmed = challenges \ + .filter(Q(officer_confirmed=True) & Q(csec_confirmed=True)) \ .count() num_rejected = challenges \ .filter(Q(officer_confirmed=False) | Q(csec_confirmed=False)) \ .count() - num_confirmed = challenges.count() - num_pending - num_rejected + num_pending = challenges.count() - num_confirmed - num_rejected num_bitbytes = BitByteActivity.objects \ .filter(participants__exact=self.request.user) \