From 3b98f975a087ccd0c021e115c37142474f0a50eb Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 24 May 2021 15:40:07 -0500 Subject: [PATCH] Fix a bug --- judge/views/contests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/judge/views/contests.py b/judge/views/contests.py index 25de29b..c9d1466 100644 --- a/judge/views/contests.py +++ b/judge/views/contests.py @@ -751,7 +751,7 @@ class ContestParticipationList(LoginRequiredMixin, ContestRankingBase): class ContestParticipationDisqualify(ContestMixin, SingleObjectMixin, View): def get_object(self, queryset=None): contest = super().get_object(queryset) - if not self.can_edit: + if not contest.is_editable_by(self.request.user): raise Http404() return contest @@ -772,7 +772,7 @@ class ContestMossMixin(ContestMixin, PermissionRequiredMixin): def get_object(self, queryset=None): contest = super().get_object(queryset) - if settings.MOSS_API_KEY is None or not self.can_edit: + if settings.MOSS_API_KEY is None or not contest.is_editable_by(self.request.user): raise Http404() if not contest.is_editable_by(self.request.user): raise Http404()