Fix permission of problem comments

This commit is contained in:
cuom1999 2021-12-17 15:46:13 -06:00
parent e4a595e3c8
commit 36f05abaeb
2 changed files with 9 additions and 4 deletions

View file

@ -80,8 +80,10 @@ class CommentedDetailView(TemplateResponseMixin, SingleObjectMixin, View):
return self.comment_page
def is_comment_locked(self):
return (CommentLock.objects.filter(page=self.get_comment_page()).exists() and
not self.request.user.has_perm('judge.override_comment_lock'))
if self.request.user.has_perm('judge.override_comment_lock'):
return False
return (CommentLock.objects.filter(page=self.get_comment_page()).exists()
or (self.request.in_contest and self.request.participation.contest.use_clarifications))
@method_decorator(login_required)
def post(self, request, *args, **kwargs):