fix: reset user password without check

This commit is contained in:
Qiu Jian
2020-09-19 00:48:53 +08:00
parent d8bc3b35f5
commit b5f01171dd
5 changed files with 12 additions and 2 deletions
+5
View File
@@ -262,6 +262,8 @@ func init() {
// DefaultProject string `help:"Default project"`
// Option []string `help:"User options"`
SkipPasswordComplexityCheck bool `help:"skip_password_complexity_check"`
}
R(&UserUpdateOptions{}, "user-update", "Update a user", func(s *mcclient.ClientSession, args *UserUpdateOptions) error {
query := jsonutils.NewDict()
@@ -282,6 +284,9 @@ func init() {
}
if args.Password != nil {
params.Add(jsonutils.NewString(*args.Password), "password")
if args.SkipPasswordComplexityCheck {
params.Add(jsonutils.JSONTrue, "skip_password_complexity_check")
}
}
if len(args.Displayname) > 0 {
params.Add(jsonutils.NewString(args.Displayname), "displayname")