[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):
|
def _handle_exception(self, exception):
|
||||||
# This is done first as the attachment path may
|
# This is done first as the attachment path may
|
||||||
# not match any HTTP controller.
|
# not match any HTTP controller.
|
||||||
attach = self._serve_attachment()
|
if isinstance(exception, werkzeug.exceptions.HTTPException) and exception.code == 404:
|
||||||
if attach:
|
attach = self._serve_attachment()
|
||||||
return attach
|
if attach:
|
||||||
|
return attach
|
||||||
|
|
||||||
# If handle_exception returns something different than None, it will be used as a response
|
# If handle_exception returns something different than None, it will be used as a response
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue