From a568d440215b43d56a36fb6eeeb056aff3e831f0 Mon Sep 17 00:00:00 2001 From: dzhuang Date: Sat, 20 May 2017 09:34:43 +0800 Subject: [PATCH] Fix not displaying ``Query participations``, along with disable it for ``view_participant_masked_profile`` --- course/enrollment.py | 4 ++- course/templates/course/course-base.html | 38 +++++++++++++----------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/course/enrollment.py b/course/enrollment.py index b7e99e92..6cafff2e 100644 --- a/course/enrollment.py +++ b/course/enrollment.py @@ -786,7 +786,9 @@ class ParticipationQueryForm(StyledForm): @transaction.atomic @course_view def query_participations(pctx): - if not pctx.has_permission(pperm.query_participation): + if (not pctx.has_permission(pperm.query_participation) + or + pctx.has_permission(pperm.view_participant_masked_profile)): raise PermissionDenied(_("may not query participations")) request = pctx.request diff --git a/course/templates/course/course-base.html b/course/templates/course/course-base.html index beae3537..1c6e3ce9 100644 --- a/course/templates/course/course-base.html +++ b/course/templates/course/course-base.html @@ -134,25 +134,27 @@ {% endif %} - {% if pperm.query_participations or pperm.manage_instant_flow_requests or pperm.preapprove_participation %} - {% endif %} {% endblock %} -- GitLab