Description Similar to
@admin .display (description = _ ('Rejudge the selected submissions' ))
def judge (self , request , queryset ):
if not request .user .has_perm ('judge.rejudge_submission' ) or not request .user .has_perm ('judge.edit_own_problem' ):
self .message_user (request , gettext ('You do not have the permission to rejudge submissions.' ),
level = messages .ERROR )
return
queryset = queryset .order_by ('id' )
if not request .user .has_perm ('judge.rejudge_submission_lot' ) and \
queryset .count () > settings .DMOJ_SUBMISSIONS_REJUDGE_LIMIT :
self .message_user (request , gettext ('You do not have the permission to rejudge THAT many submissions.' ),
level = messages .ERROR )
return
if not request .user .has_perm ('judge.edit_all_problem' ):
id = request .profile .id
queryset = queryset .filter (Q (problem__authors__id = id ) | Q (problem__curators__id = id ))
judged = len (queryset )
for model in queryset :
model .judge (rejudge = True , batch_rejudge = True , rejudge_user = request .user )
self .message_user (request , ngettext ('%d submission was successfully scheduled for rejudging.' ,
'%d submissions were successfully scheduled for rejudging.' ,
judged ) % judged )
Reactions are currently unavailable
You can’t perform that action at this time.
Similar to
online-judge/judge/admin/submission.py
Lines 166 to 186 in 9d6f4f6