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)