From cf83bc880707536525c3eaa9b37832cc0636de9c Mon Sep 17 00:00:00 2001 From: xtof Date: Fri, 11 May 2018 11:35:26 +0200 Subject: [PATCH] [FIX] Avoid crash when using auth_session_timeout module with XML-RPC API --- auth_session_timeout/__manifest__.py | 2 +- auth_session_timeout/models/res_users.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/auth_session_timeout/__manifest__.py b/auth_session_timeout/__manifest__.py index 422e98965..7a48a4878 100644 --- a/auth_session_timeout/__manifest__.py +++ b/auth_session_timeout/__manifest__.py @@ -14,7 +14,7 @@ 'maintainer': 'Odoo Community Association (OCA)', 'website': "http://acsone.eu", 'category': 'Tools', - 'version': '10.0.1.0.1', + 'version': '10.0.1.0.2', 'license': 'AGPL-3', 'data': [ 'data/ir_config_parameter_data.xml' diff --git a/auth_session_timeout/models/res_users.py b/auth_session_timeout/models/res_users.py index 308262476..04c5bc4c6 100644 --- a/auth_session_timeout/models/res_users.py +++ b/auth_session_timeout/models/res_users.py @@ -105,5 +105,6 @@ class ResUsers(models.Model): @classmethod def check(cls, *args, **kwargs): res = super(ResUsers, cls).check(*args, **kwargs) - http.request.env.user._auth_timeout_check() + if http.request: + http.request.env.user._auth_timeout_check() return res