diff --git a/anatomy/views.py b/anatomy/views.py index 7bc47e1a..339c812a 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -281,12 +281,12 @@ def loadJsonAnswer(answer): if (not isinstance(answer["cid"], int)) or ( not isinstance(answer["eid"], int) or (not isinstance(answer["ans"], str)) ): - return JsonResponse({"success": False}) + return JsonResponse({"success": False, "error": "cid or eid or answers not defined"}) # The model should catch invalid data but this should be less intensive max_int = 10000000 if answer["cid"] > max_int or answer["eid"] > max_int: - return JsonResponse({"success": False}) + return JsonResponse({"success": False, "error": "invalid cid"}) exam = get_object_or_404(Exam, pk=answer["eid"])