Commit 23926798 authored by Anton Akhmerov's avatar Anton Akhmerov

better error message

parent 7f961a88
Pipeline #10747 passed with stages
in 2 minutes and 7 seconds
......@@ -35,7 +35,7 @@ class Exams(Resource):
def delete(self, exam_id):
exam = Exam.get(id=exam_id)
if exam is None:
abort(404)
return dict(status=404, message='Exam does not exist.'), 404
elif exam.finalized:
return dict(status=409, message='Cannot delete a finalized exam.'), 409
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment