From 829e6a802de44aef05f682801b3a80d29d063d27 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Sun, 26 May 2024 22:26:38 -0500 Subject: [PATCH] Fix active contest list --- judge/views/contests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/judge/views/contests.py b/judge/views/contests.py index 42111ae..71e98e7 100644 --- a/judge/views/contests.py +++ b/judge/views/contests.py @@ -247,7 +247,11 @@ class ContestList( @cached_property def _active_contests_ids(self): - return self._active_participations().values_list("contest_id", flat=True) + return [ + participation.contest_id + for participation in self._active_participations().select_related("contest") + if not participation.ended + ] def _get_current_contests_queryset(self): return (