1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 16:44:26 +00:00

add default user visibility to cli command "admin user create" (#22750)

Fixes https://github.com/go-gitea/gitea/issues/22523
This commit is contained in:
yp05327 2023-02-05 02:35:04 +09:00 committed by GitHub
parent 8574a6433f
commit e35f8e15a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -578,12 +578,16 @@ func runCreateUser(c *cli.Context) error {
restricted = util.OptionalBoolOf(c.Bool("restricted"))
}
// default user visibility in app.ini
visibility := setting.Service.DefaultUserVisibilityMode
u := &user_model.User{
Name: username,
Email: c.String("email"),
Passwd: password,
IsAdmin: c.Bool("admin"),
MustChangePassword: changePassword,
Visibility: visibility,
}
overwriteDefault := &user_model.CreateUserOverwriteOptions{