diff --git a/judge/comments.py b/judge/comments.py index 6e7c7e6..7408e68 100644 --- a/judge/comments.py +++ b/judge/comments.py @@ -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): diff --git a/templates/problem/problem.html b/templates/problem/problem.html index a0e24a3..43e9ddb 100644 --- a/templates/problem/problem.html +++ b/templates/problem/problem.html @@ -164,8 +164,11 @@ {% endif %}
{{ _('All submissions') }}
{{ _('Best submissions') }}
-
-
{{ _('Discuss') }}
+ + {% if not contest_problem or not contest_problem.contest.use_clarifications %} +
+
{{ _('Discuss') }}
+ {% endif %} {% if editorial and editorial.is_public and not (request.user.is_authenticated and request.profile.current_contest) %}
{{ _('Read editorial') }}