From c39f1762963009c11ceaca62da21dbb0fe4dc075 Mon Sep 17 00:00:00 2001 From: int-y1 Date: Tue, 2 Jan 2024 00:20:17 -0500 Subject: [PATCH] Sort contest users with 0 points by submission count --- judge/views/contests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/judge/views/contests.py b/judge/views/contests.py index 5ae7428fe8..880e128f7e 100644 --- a/judge/views/contests.py +++ b/judge/views/contests.py @@ -677,7 +677,8 @@ def base_contest_ranking_list(contest, problems, queryset): def contest_ranking_list(contest, problems): return base_contest_ranking_list(contest, problems, contest.users.filter(virtual=0) .prefetch_related('user__organizations') - .order_by('is_disqualified', '-score', 'cumtime', 'tiebreaker')) + .annotate(submission_cnt=Count('submission')) + .order_by('is_disqualified', '-score', 'cumtime', 'tiebreaker', '-submission_cnt')) def get_contest_ranking_list(request, contest, participation=None, ranking_list=contest_ranking_list,