Fixes for django 4 (remove is_ajax)
This commit is contained in:
+4
-4
@@ -634,7 +634,7 @@ def create_body_part(request):
|
||||
|
||||
@csrf_exempt
|
||||
def get_body_part_id(request):
|
||||
if request.is_ajax():
|
||||
if request.accepts("application/json")():
|
||||
body_part_name = request.GET["body_part_name"]
|
||||
body_part_id = BodyPart.objects.get(name=body_part_name).id
|
||||
data = {
|
||||
@@ -660,7 +660,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 = {
|
||||
@@ -686,7 +686,7 @@ def create_structure(request):
|
||||
|
||||
@csrf_exempt
|
||||
def get_structure_id(request):
|
||||
if request.is_ajax():
|
||||
if request.accepts("application/json")():
|
||||
structure_name = request.GET["structure_name"]
|
||||
structure_id = Structure.objects.get(name=structure_name).id
|
||||
data = {
|
||||
@@ -718,7 +718,7 @@ class AnatomyQuestionView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
||||
|
||||
@user_is_author_or_anatomy_checker
|
||||
def question_save_annotation(request, pk):
|
||||
if request.is_ajax() and request.method == "POST":
|
||||
if request.method == "POST":
|
||||
question = get_object_or_404(AnatomyQuestion, pk=pk)
|
||||
|
||||
question.image_annotations = request.POST.get("annotation")
|
||||
|
||||
Reference in New Issue
Block a user