diff --git a/addons/auth_totp/models/res_users.py b/addons/auth_totp/models/res_users.py index 86202d9db2f..e97d1702963 100644 --- a/addons/auth_totp/models/res_users.py +++ b/addons/auth_totp/models/res_users.py @@ -48,7 +48,7 @@ class Users(models.Model): To be overriden if needs to be disabled for other 2FA providers """ - if self._mfa_type(): + if request and self._mfa_type(): key = request.httprequest.cookies.get('td_id') if key: if request.env['auth_totp.device']._check_credentials_for_uid(