This commit is contained in:
Ross
2021-12-12 16:40:21 +00:00
parent bc51f829eb
commit da7ac995c6
+6 -5
View File
@@ -669,11 +669,12 @@ class ExamViews(View, LoginRequiredMixin):
n = 0 n = 0
for answer in json.loads(request.POST.get("answers")): for answer in json.loads(request.POST.get("answers")):
try: ret_status, ret = self.loadJsonAnswer(answer)
ret_status, ret = self.loadJsonAnswer(answer) # try:
except: # ret_status, ret = self.loadJsonAnswer(answer)
# We catch the error here so users get an error (rather than 500) # except:
return JsonResponse({"success": False, "error": "Invalid data"}) # # We catch the error here so users get an error (rather than 500)
# return JsonResponse({"success": False, "error": "Invalid data"})
# if ret is not True: # if ret is not True:
# return ret # return ret