Skip to content
Snippets Groups Projects
Commit 8a430c4a authored by Christophe Simonis's avatar Christophe Simonis
Browse files

[FIX] base: ir.http: only server_attachement for 404 errors

fixes #6792
parent 1cf57238
No related branches found
No related tags found
No related merge requests found
......@@ -137,9 +137,10 @@ class ir_http(osv.AbstractModel):
def _handle_exception(self, exception):
# This is done first as the attachment path may
# not match any HTTP controller.
attach = self._serve_attachment()
if attach:
return attach
if isinstance(exception, werkzeug.exceptions.HTTPException) and exception.code == 404:
attach = self._serve_attachment()
if attach:
return attach
# If handle_exception returns something different than None, it will be used as a response
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment