Commit a6c26f7 1 parent cab2019 commit a6c26f7 Copy full SHA for a6c26f7
File tree 2 files changed +8
-12
lines changed
auth_sms_auth_signup/tests
2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -140,14 +140,10 @@ def _auth_sms_check_rate_limit(self):
140
140
<= rate_limit_limit
141
141
)
142
142
143
- # def _register_hook(self):
144
- # # don't log our exceptions during RPC dispatch
145
- # if AccessDeniedNoSmsCode not in http.NO_POSTMORTEM:
146
- # http.NO_POSTMORTEM = tuple(
147
- # list(http.NO_POSTMORTEM)
148
- # + [
149
- # AccessDeniedNoSmsCode,
150
- # AccessDeniedWrongSmsCode,
151
- # ],
152
- # )
153
- # return super(ResUsers, self)._register_hook()
143
+ def _mfa_type (self ):
144
+ """If auth_sms enabled, disable other totp methods."""
145
+ result = super ()._mfa_type ()
146
+ if len (self ) != 1 or not self .auth_sms_enabled :
147
+ return result
148
+ # If we get here, we have one user record that is enabled for sms auth.
149
+ return "auth_sms"
Original file line number Diff line number Diff line change 1
1
# Copyright 2019 Therp BV <https://therp.nl>
2
2
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3
- from mock import patch
3
+ from unittest . mock import patch
4
4
5
5
from odoo .addons .auth_sms .tests .common import Common
6
6
You can’t perform that action at this time.
0 commit comments