From 5f044964badcb19240539bc70f50b91b21a80ab1 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 2 Jun 2021 08:42:22 -0500 Subject: [PATCH] Fix a bug in stat page --- judge/views/contests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge/views/contests.py b/judge/views/contests.py index eea60b8..89bcc9e 100644 --- a/judge/views/contests.py +++ b/judge/views/contests.py @@ -563,11 +563,11 @@ class ContestStats(TitleMixin, ContestMixin, DetailView): problem_points = [[] for _ in range(num_problems)] point_count_queryset = list(queryset.values('problem__code', 'contest__points', 'contest__problem__points') .annotate(count=Count('contest__points')) - .filter(points__isnull=False) .order_by('problem__code', 'contest__points') .values_list('problem__code', 'contest__points', 'contest__problem__points', 'count')) counter = [[0 for _ in range(self.POINT_BIN + 1)] for _ in range(num_problems)] for problem_code, point, max_point, count in point_count_queryset: + if point == None: continue problem_idx = codes.index(problem_code) bin_idx = math.floor(point * self.POINT_BIN / max_point) counter[problem_idx][bin_idx] += count