[FIX] base: ir.http: only server_attachement for 404 errors
fixes #6792
This commit is contained in:
parent
1cf5723835
commit
8a430c4a23
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue