.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user