Fixes for django 4 (remove is_ajax)
This commit is contained in:
+3
-3
@@ -590,7 +590,7 @@ def create_examination(request):
|
||||
|
||||
@csrf_exempt
|
||||
def get_examination_id(request):
|
||||
if request.is_ajax():
|
||||
if request.accepts("application/json")():
|
||||
examination_name = request.GET["examination_name"]
|
||||
examination_id = Examination.objects.get(name=examination_name).id
|
||||
data = {
|
||||
@@ -1210,7 +1210,7 @@ class UserAnswerDelete(SuperuserRequiredMixin, DeleteView):
|
||||
|
||||
@user_passes_test(lambda u: u.is_superuser)
|
||||
def user_answer_delete_multiple(request):
|
||||
if request.is_ajax():
|
||||
if request.accepts("application/json")():
|
||||
answer_ids = json.loads(request.POST["answer_ids"])
|
||||
|
||||
# We could probably delete them all at once....
|
||||
@@ -1244,7 +1244,7 @@ def question_review(request, pk):
|
||||
"""
|
||||
Return a json representation of the question when the exam is active
|
||||
"""
|
||||
if request.is_ajax():
|
||||
if request.accepts("application/json")():
|
||||
exam = get_object_or_404(Exam, pk=pk)
|
||||
|
||||
if not exam.publish_results:
|
||||
|
||||
Reference in New Issue
Block a user