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,