fix non exam mode

This commit is contained in:
Ross
2023-02-20 10:04:02 +00:00
parent b0529839a1
commit 850506a9b8
+2 -2
View File
@@ -1588,7 +1588,7 @@ class ExamViews(View, LoginRequiredMixin):
user_id = None
else:
user_id = request.user.pk
if not exam.check_cid_user(cid, passcode, request, user_id):
if self.exam_mode and not exam.check_cid_user(cid, passcode, request, user_id):
raise Http404("No available exam")
# exam_json_cache = cache.get("{}_exam_json_{}".format(self.app_name, pk))
@@ -1650,7 +1650,7 @@ class ExamViews(View, LoginRequiredMixin):
"""
exam = get_object_or_404(self.Exam, pk=pk)
if not exam.active and not self.check_user_access(request.user, pk):
if self.exam_mode and not exam.active and not self.check_user_access(request.user, pk):
raise Http404("No available exam")
# Check access for users