.
This commit is contained in:
+3
-2
@@ -198,14 +198,15 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
|
||||
@method_decorator(login_required)
|
||||
def exam_list(self, request):
|
||||
if request.user not in exam.author.all():
|
||||
exams = self.Exam.objects.all()
|
||||
|
||||
if self.app_name == "rapids" and not request.user.groups.filter(name='rapid_checker').exists():
|
||||
raise PermissionDenied
|
||||
if self.app_name == "anatomy" and not request.user.groups.filter(name='anatomy_checker').exists():
|
||||
raise PermissionDenied
|
||||
if self.app_name == "longs" and not request.user.groups.filter(name='longs_checker').exists():
|
||||
raise PermissionDenied
|
||||
exams = self.Exam.objects.all()
|
||||
|
||||
return render(request, "{}/exam_list.html".format(self.app_name), {"exams": exams})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user