Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions password_security/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import re
from datetime import datetime, timedelta

from odoo import _, api, fields, models
from odoo import _, api, fields, models, modules
from odoo.exceptions import UserError, ValidationError
from odoo.tools import config


def delta_now(**kwargs):
Expand Down Expand Up @@ -68,6 +69,11 @@ def get_password_policy(self):
return data

def _check_password_policy(self, passwords):
if (
config["test_enable"]
and not modules.module.current_test.test_module == "password_security"
):
return True
result = super()._check_password_policy(passwords)

for password in passwords:
Expand Down Expand Up @@ -114,7 +120,10 @@ def _check_password(self, password):

def _check_password_rules(self, password):
self.ensure_one()
if not password:
if not password or (
config["test_enable"]
and not modules.module.current_test.test_module == "password_security"
):
return True
pwd_params = self._get_all_password_params()
password_regex = [
Expand Down
Loading