sachet/server/views_common.py: add an extra error check on patch()
This commit is contained in:
parent
af21887402
commit
831017092a
@ -100,6 +100,13 @@ class ModelAPI(MethodView):
|
|||||||
return jsonify(model.get_schema().dump(model))
|
return jsonify(model.get_schema().dump(model))
|
||||||
|
|
||||||
def patch(self, model):
|
def patch(self, model):
|
||||||
|
if not model:
|
||||||
|
resp = {
|
||||||
|
"status": "fail",
|
||||||
|
"message": "This resource does not exist.",
|
||||||
|
}
|
||||||
|
return jsonify(resp), 404
|
||||||
|
|
||||||
model_schema = model.get_schema()
|
model_schema = model.get_schema()
|
||||||
|
|
||||||
if not model:
|
if not model:
|
||||||
|
Loading…
Reference in New Issue
Block a user