diff --git a/judge/views/submission.py b/judge/views/submission.py index 8de7796b0..b70b47d22 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -331,7 +331,7 @@ def get(self, request, *args, **kwargs): def abort_submission(request, submission): submission = get_object_or_404(Submission, id=int(submission)) if (not request.user.has_perm('judge.abort_any_submission') and - (submission.rejudged_date is not None or request.profile != submission.user)): + (submission.rejudged_date is not None or request.profile != submission.user or request.official_contest_mode)): raise PermissionDenied() submission.abort() return HttpResponseRedirect(reverse('submission_status', args=(submission.id,))) diff --git a/templates/submission/status.html b/templates/submission/status.html index 44cd0d784..952d28e44 100644 --- a/templates/submission/status.html +++ b/templates/submission/status.html @@ -106,7 +106,7 @@
{% include "submission/status-testcases.html" %}
{% if not submission.is_graded %} - {% if request.user == submission.user.user or perms.judge.abort_any_submission %} + {% if (request.user == submission.user.user and not request.official_contest_mode) or perms.judge.abort_any_submission %}