Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add must-change-password flag to cli for creating a user #4955

Merged
merged 9 commits into from
Oct 20, 2018
Prev Previous commit
Next Next commit
simplify by removing unnneccessary if/else
  • Loading branch information
adelowo committed Oct 6, 2018
commit ddced419d8c62ca3105fbb5fbb9260ad9b59b065
6 changes: 2 additions & 4 deletions cmd/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,11 @@ func runCreateUser(c *cli.Context) error {
return err
}

var changePassword bool
// always default to true
var changePassword = true

if c.IsSet("must-change-password") {
changePassword = c.Bool("must-change-password")
} else {
// always default to true
changePassword = true
}

if err := models.CreateUser(&models.User{
Expand Down