Fix permission of problem comments
This commit is contained in:
parent
e4a595e3c8
commit
36f05abaeb
2 changed files with 9 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue