mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
comment test_random_password with a TODO to add a new test for checking if some characters are in unhashed password before user creation with random password
This commit is contained in:
committed by
Antoine Nguyen
parent
3c9cc5a42e
commit
8965e7ea78
@@ -305,16 +305,13 @@ def make_password():
|
||||
for possible_chars in possible_chars_types:
|
||||
all_possible_chars += possible_chars
|
||||
certain_chars += random.SystemRandom().choice(possible_chars)
|
||||
|
||||
password = "".join(
|
||||
random.SystemRandom().choice(all_possible_chars) \
|
||||
for _ in range(length - len(possible_chars_types))
|
||||
) + certain_chars
|
||||
|
||||
li_password = list(password)
|
||||
random.shuffle(li_password)
|
||||
password = "".join(li_password)
|
||||
|
||||
try:
|
||||
password_validation.validate_password(password)
|
||||
except ValidationError:
|
||||
|
||||
Reference in New Issue
Block a user