From 2ac300ff023d254a4647a65a256a945388a5d9c9 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Thu, 16 Nov 2023 20:35:15 -0600 Subject: [PATCH] Fix contest search --- 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 6fc4130..d76bf66 100644 --- a/judge/views/contests.py +++ b/judge/views/contests.py @@ -144,7 +144,11 @@ class ContestList( context_object_name = "past_contests" all_sorts = frozenset(("name", "user_count", "start_time")) default_desc = frozenset(("name", "user_count")) - default_sort = "-start_time" + + def get_default_sort_order(self, request): + if "contest" in request.GET and settings.ENABLE_FTS: + return "-relevance" + return "-start_time" @cached_property def _now(self):