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,8 +2498,9 @@ class PasswordArgumentParser(YunoHostArgumentFormatParser):
|
|||
if any(char in question.value for char in self.forbidden_chars):
|
||||
raise YunohostError('pattern_password_app', forbidden_chars=self.forbidden_chars)
|
||||
|
||||
from yunohost.utils.password import assert_password_is_strong_enough
|
||||
assert_password_is_strong_enough('user', question.value)
|
||||
if not question.optional:
|
||||
from yunohost.utils.password import assert_password_is_strong_enough
|
||||
assert_password_is_strong_enough('user', question.value)
|
||||
|
||||
return super(PasswordArgumentParser, self)._post_parse_value(question)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue