We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 938d1f7 commit d2bc4deCopy full SHA for d2bc4de
cmd/admin.go
@@ -289,13 +289,22 @@ func runCreateUser(c *cli.Context) error {
289
return err
290
}
291
292
+ var changePassword bool
293
+
294
+ if c.IsSet("must-change-password") {
295
+ changePassword = c.Bool("must-change-password")
296
+ } else {
297
+ // always default to true
298
+ changePassword = true
299
+ }
300
301
if err := models.CreateUser(&models.User{
302
Name: c.String("name"),
303
Email: c.String("email"),
304
Passwd: c.String("password"),
305
IsActive: true,
306
IsAdmin: c.Bool("admin"),
- MustChangePassword: c.Bool("must-change-password"),
307
+ MustChangePassword: changePassword,
308
}); err != nil {
309
return fmt.Errorf("CreateUser: %v", err)
310
0 commit comments