.
This commit is contained in:
@@ -33,6 +33,7 @@ from .forms import (
|
||||
from .models import (
|
||||
Rapid,
|
||||
Abnormality,
|
||||
RapidImage,
|
||||
Region,
|
||||
Examination,
|
||||
Exam,
|
||||
@@ -1105,3 +1106,17 @@ def question_save_annotation(request, pk):
|
||||
class ExamClone(ExamCloneMixin, ExamCreate):
|
||||
"""Clone exam view"""
|
||||
|
||||
|
||||
@login_required
|
||||
def get_question_by_hash(request, pk):
|
||||
if request.is_ajax() and request.method == "POST":
|
||||
|
||||
hash = json.loads(request.POST.get("hash"))
|
||||
|
||||
try:
|
||||
question = RapidImage.objects.get(image_md5_hash=hash)
|
||||
data = {"status": "success", "id": question.pk}
|
||||
return JsonResponse(data, status=200)
|
||||
except RapidImage.DoesNotExist:
|
||||
data = {"status": "success", "id": False}
|
||||
return JsonResponse(data, status=200)
|
||||
Reference in New Issue
Block a user