summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérome Maes <jem@openerp.com>2017-08-11 11:56:42 +0200
committerJérome Maes <jem@openerp.com>2017-08-16 15:30:01 +0200
commit9dc173cc2e13eb6cd3a8845178c2d3fa95a9cadf (patch)
tree257d63e3e279121181116b1d9ef373495f3772ce
parent2972976962617d4b8a0113bae58c640ab41cdff8 (diff)
[FIX] ir_http: uniformize method signature to avoid error when catching error
-rw-r--r--addons/http_routing/models/ir_http.py2
-rw-r--r--addons/website/models/ir_http.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/addons/http_routing/models/ir_http.py b/addons/http_routing/models/ir_http.py
index 93015232b54..1b5ee06f84c 100644
--- a/addons/http_routing/models/ir_http.py
+++ b/addons/http_routing/models/ir_http.py
@@ -389,7 +389,7 @@ class IrHttp(models.AbstractModel):
_, path = rule.build(arguments)
assert path is not None
except Exception as e:
- return cls._handle_exception(e, code=404)
+ return cls._handle_exception(e)
if getattr(request, 'is_frontend_multilang', False) and request.httprequest.method in ('GET', 'HEAD'):
generated_path = werkzeug.url_unquote_plus(path)
diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py
index 7381737f245..0f6369758cc 100644
--- a/addons/website/models/ir_http.py
+++ b/addons/website/models/ir_http.py
@@ -90,7 +90,8 @@ class Http(models.AbstractModel):
return super(Http, cls)._get_default_lang()
@classmethod
- def _handle_exception(cls, exception, code=500):
+ def _handle_exception(cls, exception):
+ code = 500 # default code
is_website_request = bool(getattr(request, 'is_frontend', False) and getattr(request, 'website', False))
if not is_website_request:
# Don't touch non website requests exception handling