Sort contest users with 0 points by submission count

This commit is contained in:
int-y1 2024-01-02 00:20:17 -05:00 committed by Roger Fu
parent 18e49e0956
commit c39f176296

View File

@ -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,