Skip to content

Commit

Permalink
[FIX] auth_sms: always get config parm with sudo()
Browse files Browse the repository at this point in the history
  • Loading branch information
NL66278 committed Nov 28, 2024
1 parent 4b09219 commit 9aa4f28
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions auth_sms/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def _auth_sms_generate_code(self):
random.choice(choices)
for dummy in range(
int(
self.env["ir.config_parameter"].get_param(
self.env["ir.config_parameter"]
.sudo()
.get_param(
"auth_sms.code_length",
8,
),
Expand Down Expand Up @@ -114,13 +116,17 @@ def _auth_sms_check_rate_limit(self):
"""return false if the user has requested an SMS code too often"""
self.ensure_one()
rate_limit_hours = float(
self.env["ir.config_parameter"].get_param(
self.env["ir.config_parameter"]
.sudo()
.get_param(
"auth_sms.rate_limit_hours",
24,
)
)
rate_limit_limit = float(
self.env["ir.config_parameter"].get_param(
self.env["ir.config_parameter"]
.sudo()
.get_param(
"auth_sms.rate_limit_limit",
10,
)
Expand Down

0 comments on commit 9aa4f28

Please sign in to comment.