mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
check if password is strong enough only if it's not an optional argument
This commit is contained in:
parent
6a550f9318
commit
93fd101663
1 changed files with 3 additions and 2 deletions
|
@ -2498,6 +2498,7 @@ class PasswordArgumentParser(YunoHostArgumentFormatParser):
|
||||||
if any(char in question.value for char in self.forbidden_chars):
|
if any(char in question.value for char in self.forbidden_chars):
|
||||||
raise YunohostError('pattern_password_app', forbidden_chars=self.forbidden_chars)
|
raise YunohostError('pattern_password_app', forbidden_chars=self.forbidden_chars)
|
||||||
|
|
||||||
|
if not question.optional:
|
||||||
from yunohost.utils.password import assert_password_is_strong_enough
|
from yunohost.utils.password import assert_password_is_strong_enough
|
||||||
assert_password_is_strong_enough('user', question.value)
|
assert_password_is_strong_enough('user', question.value)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue