summaryrefslogtreecommitdiff
path: root/addons/auth_password_policy/models/res_users.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/auth_password_policy/models/res_users.py')
-rw-r--r--addons/auth_password_policy/models/res_users.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/auth_password_policy/models/res_users.py b/addons/auth_password_policy/models/res_users.py
index c44c4673f4b..b938acd5ee9 100644
--- a/addons/auth_password_policy/models/res_users.py
+++ b/addons/auth_password_policy/models/res_users.py
@@ -6,6 +6,13 @@ from odoo.exceptions import UserError
class ResUsers(models.Model):
_inherit = 'res.users'
+ @api.model
+ def get_password_policy(self):
+ params = self.env['ir.config_parameter'].sudo()
+ return {
+ 'minlength': int(params.get_param('auth_password_policy.minlength', default=0)),
+ }
+
def _set_password(self):
self._check_password_policy(self.mapped('password'))