start adding exam dates
This commit is contained in:
+6
-6
@@ -1487,7 +1487,7 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
f"{exam.app_name=}, {exam.name=}, {cid=}, {passcode=}, {request.user=}"
|
||||
)
|
||||
if exam.exam_mode and not exam.check_cid_user(
|
||||
cid, passcode, request=request, user_id=request.user.pk
|
||||
cid, passcode, user=request.user, user_id=request.user.pk
|
||||
):
|
||||
print(exam.name, "fail")
|
||||
continue
|
||||
@@ -1736,7 +1736,7 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
user_id = None
|
||||
else:
|
||||
user_id = request.user.pk
|
||||
if exam.exam_mode and not exam.check_cid_user(cid, passcode, request, user_id):
|
||||
if exam.exam_mode and not exam.check_cid_user(cid, passcode, request.user, user_id):
|
||||
raise Http404("No available exam")
|
||||
|
||||
# exam_json_cache = cache.get("{}_exam_json_{}".format(self.app_name, pk))
|
||||
@@ -1811,7 +1811,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 not exam.check_cid_user(cid, passcode, request.user, user_id):
|
||||
raise Http404("No available exam")
|
||||
|
||||
time = timezone.now()
|
||||
@@ -1850,7 +1850,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 not exam.check_cid_user(cid, passcode, request.user, user_id):
|
||||
raise Http404("No available exam")
|
||||
|
||||
if request.GET.get("_"):
|
||||
@@ -1883,7 +1883,7 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
|
||||
print("CID", cid)
|
||||
|
||||
if not exam.check_cid_user(cid, passcode, request, user_id):
|
||||
if not exam.check_cid_user(cid, passcode, request.user, user_id):
|
||||
raise Http404("No available exam")
|
||||
|
||||
return redirect("{}:question_json_unbased".format(self.app_name), pk=sk)
|
||||
@@ -1921,7 +1921,7 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
if not exam.exam_mode:
|
||||
raise Http404("Packet not in exam mode")
|
||||
|
||||
if not exam.check_cid_user(cid, passcode, request):
|
||||
if not exam.check_cid_user(cid, passcode, request.user):
|
||||
raise Http404("Error accessing exam")
|
||||
|
||||
if user is not None:
|
||||
|
||||
Reference in New Issue
Block a user