[FIX] ir_http: uniformize method signature to avoid error when catching error
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user