From edb0bf30d8625665b5ea97e5d6df4d1bd1d78178 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Sat, 14 Oct 2023 15:04:11 -0500 Subject: [PATCH] Sort contest by relevance --- judge/views/contests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/judge/views/contests.py b/judge/views/contests.py index e1fe5ae..a84d98b 100644 --- a/judge/views/contests.py +++ b/judge/views/contests.py @@ -236,9 +236,10 @@ class ContestList( active.append(participation) present.remove(participation.contest) - active.sort(key=attrgetter("end_time", "key")) - present.sort(key=attrgetter("end_time", "key")) - future.sort(key=attrgetter("start_time")) + if not ("contest" in self.request.GET and settings.ENABLE_FTS): + active.sort(key=attrgetter("end_time", "key")) + present.sort(key=attrgetter("end_time", "key")) + future.sort(key=attrgetter("start_time")) context["active_participations"] = active context["current_contests"] = present context["future_contests"] = future