Skip to content

Commit

Permalink
Merge pull request compserv#210 from alexander-zw/challenge-count-fix
Browse files Browse the repository at this point in the history
Fix count of officer challenges on candidate portal
  • Loading branch information
bri25yu authored Apr 6, 2020
2 parents 694a7da + c5571c0 commit 3ddd229
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hknweb/candidate/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 3ddd229

Please sign in to comment.