From 93fd101663b84e7f2310c9773c658f8b91724c8e Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 25 Nov 2020 11:14:15 +0100 Subject: [PATCH] check if password is strong enough only if it's not an optional argument --- src/yunohost/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 076096eef..1d103f00c 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -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)