diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index ff56c2ac8..8eee048f2 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -165,8 +165,11 @@ user: full: --change-password help: New password to set metavar: PASSWORD + nargs: "?" + const: 0 extra: pattern: *pattern_password + comment: good_practices_about_user_password --add-mailforward: help: Mailforward addresses to add nargs: "*" diff --git a/src/yunohost/user.py b/src/yunohost/user.py index 67fd43a03..6968744b3 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -325,7 +325,9 @@ def user_update(operation_logger, username, firstname=None, lastname=None, mail= if lastname and firstname: new_attr_dict['cn'] = new_attr_dict['displayName'] = [firstname + ' ' + lastname] - if change_password: + if change_password is not None: + if not change_password: + change_password = msignals.prompt(m18n.n("ask_password"), True, True) # Ensure sufficiently complex password assert_password_is_strong_enough("user", change_password)