Skip to content

Commit d2bc4de

Browse files
committed
default to true
1 parent 938d1f7 commit d2bc4de

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cmd/admin.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,22 @@ func runCreateUser(c *cli.Context) error {
289289
return err
290290
}
291291

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+
292301
if err := models.CreateUser(&models.User{
293302
Name: c.String("name"),
294303
Email: c.String("email"),
295304
Passwd: c.String("password"),
296305
IsActive: true,
297306
IsAdmin: c.Bool("admin"),
298-
MustChangePassword: c.Bool("must-change-password"),
307+
MustChangePassword: changePassword,
299308
}); err != nil {
300309
return fmt.Errorf("CreateUser: %v", err)
301310
}

0 commit comments

Comments
 (0)