.
This commit is contained in:
+16
-3
@@ -673,10 +673,23 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
|
||||
exam = get_object_or_404(self.Exam, pk=pk)
|
||||
|
||||
if "edit_cid_users" in request.POST:
|
||||
user_ids = json.loads(request.POST.get("cid_user_ids"))
|
||||
if "toggle_cid_user" in request.POST:
|
||||
user_id = json.loads(request.POST.get("cid_user_id"))
|
||||
|
||||
add = request.POST.get("add")
|
||||
|
||||
data = {"status": "success"}
|
||||
cid_user = CidUser.objects.filter(pk=user_id)
|
||||
|
||||
app_exam_map = {}
|
||||
app_exam_map["rapids"] = cid_user.rapid_exams
|
||||
|
||||
if add:
|
||||
app_exam_map[self.app_name].add(pk)
|
||||
else:
|
||||
app_exam_map[self.app_name].remove(pk)
|
||||
|
||||
|
||||
data = {"status": "success", "added": add}
|
||||
return JsonResponse(data, status=200)
|
||||
|
||||
if "add_exam_questions" in request.POST:
|
||||
|
||||
Reference in New Issue
Block a user