From f0c779391db581bb0e3d05c53f6f123a8c51e2b6 Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 3 May 2022 19:00:15 +0100 Subject: [PATCH] . --- generic/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generic/views.py b/generic/views.py index 43553be2..82412259 100644 --- a/generic/views.py +++ b/generic/views.py @@ -294,6 +294,9 @@ class ExamViews(View, LoginRequiredMixin): [boolean]: True if the user has access """ print("****", user, exam_id) + if user.is_superuser: + return True + if exam_id is not None: exam = get_object_or_404(self.Exam, pk=exam_id) if (exam.open_access and exam.active) or user in exam.get_author_objects(): @@ -347,6 +350,9 @@ class ExamViews(View, LoginRequiredMixin): Returns: [boolean]: True if the user has access """ + if user.is_superuser: + return True + # If a user is an exam author they should have acccess if exam_id is not None: exam = get_object_or_404(self.Exam, pk=exam_id)