Commit 7b52d886 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

erp5_api_style: when no document is found, return 404 error

parent b7066cf2
...@@ -87,7 +87,11 @@ if mode in ("get", "put"): ...@@ -87,7 +87,11 @@ if mode in ("get", "put"):
else: else:
document = context.jIOWebSection_getObjectFromData(data) document = context.jIOWebSection_getObjectFromData(data)
if document is None: if document is None:
return logError("The data you provided did not allow to find the corresponding document", error_name="API-JSON-DOCUMENT-NOT-FOUND") return logError(
"The data you provided did not allow to find the corresponding document",
error_name="API-JSON-DOCUMENT-NOT-FOUND",
error_code=404,
)
else: else:
document = context document = context
......
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