.
This commit is contained in:
+6
-3
@@ -217,13 +217,16 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
#print("test", Exam.objects.all().get(id=pk))
|
#print("test", Exam.objects.all().get(id=pk))
|
||||||
exam = get_object_or_404(self.Exam, pk=pk)
|
exam = get_object_or_404(self.Exam, pk=pk)
|
||||||
|
|
||||||
if request.user not in exam.author.all():
|
if self.app_name == "longs":
|
||||||
|
if request.user not in exam.get_author_objects:
|
||||||
|
if not request.user.groups.filter(name='long_checker').exists():
|
||||||
|
raise PermissionDenied
|
||||||
|
|
||||||
|
elif request.user not in exam.author.all():
|
||||||
if self.app_name == "rapids" and not request.user.groups.filter(name='rapid_checker').exists():
|
if self.app_name == "rapids" and not request.user.groups.filter(name='rapid_checker').exists():
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
if self.app_name == "anatomy" and not request.user.groups.filter(name='anatomy_checker').exists():
|
if self.app_name == "anatomy" and not request.user.groups.filter(name='anatomy_checker').exists():
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
if self.app_name == "longs" and not request.user.groups.filter(name='long_checker').exists():
|
|
||||||
raise PermissionDenied
|
|
||||||
|
|
||||||
questions = exam.exam_questions.all()
|
questions = exam.exam_questions.all()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user