mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-25 21:09:44 +09:00
fix(cli): default must-change-password to false for bot users (#38175)
This commit is contained in:
@@ -158,7 +158,8 @@ func runCreateUser(ctx context.Context, c *cli.Command) error {
|
||||
}
|
||||
|
||||
isAdmin := c.Bool("admin")
|
||||
mustChangePassword := true // always default to true
|
||||
// Only local, existing, regular users should be forced to update their password. Bot users for example are non-interactive
|
||||
mustChangePassword := userType == user_model.UserTypeIndividual
|
||||
if c.IsSet("must-change-password") {
|
||||
if userType != user_model.UserTypeIndividual {
|
||||
return errors.New("must-change-password flag can only be set for individual users")
|
||||
|
||||
Reference in New Issue
Block a user