[FIX] ir_http: uniformize method signature to avoid error when catching error

This commit is contained in:
Jérome Maes
2017-08-16 15:30:01 +02:00
parent 2972976962
commit 9dc173cc2e
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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)
+2 -1
View File
@@ -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