Skip to content

Commit

Permalink
Fix statistics summary 500 error
Browse files Browse the repository at this point in the history
Someone at MAGStock has no age group label for some reason, causing the summary page to throw a 500 error. This should work around the issue.
  • Loading branch information
kitsuta committed May 27, 2024
1 parent a2250b9 commit 0a7b3a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion uber/site_sections/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ def index(self, session):

if a.badge_status not in [c.INVALID_GROUP_STATUS, c.INVALID_STATUS, c.IMPORTED_STATUS, c.REFUNDED_STATUS]:
counts['paid'][a.paid_label] += 1
counts['ages'][a.age_group_label] += 1
if a.age_group_label:
counts['ages'][a.age_group_label] += 1
else:
counts['ages'][c.AGE_GROUPS[c.AGE_UNKNOWN]]
for val in a.ribbon_ints:
counts['ribbons'][c.RIBBONS[val]] += 1
counts['badges'][a.badge_type_label] += 1
Expand Down

0 comments on commit 0a7b3a6

Please sign in to comment.