diff options
author | yp05327 <576951401@qq.com> | 2023-03-31 01:29:57 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-30 12:29:57 -0400 |
commit | c09eab54859f34247b9cf9278fa322f9ecfc6afa (patch) | |
tree | 2155ad769b21ba544e313162c1cc8f326a497bf0 /routers/web | |
parent | 525b7382d31079333dbffba625af1c0e177546db (diff) | |
download | gitea-c09eab54859f34247b9cf9278fa322f9ecfc6afa.tar.gz gitea-c09eab54859f34247b9cf9278fa322f9ecfc6afa.zip |
Fix incorrect visibility dropdown list in add/edit user page (#23804)
Visibility dropdown list will not work in add/edit user page when error
occurred
Diffstat (limited to 'routers/web')
-rw-r--r-- | routers/web/admin/users.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/web/admin/users.go b/routers/web/admin/users.go index 1bb9d04806..5fb2a3e5d6 100644 --- a/routers/web/admin/users.go +++ b/routers/web/admin/users.go @@ -105,6 +105,7 @@ func NewUserPost(ctx *context.Context) { ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminUsers"] = true ctx.Data["DefaultUserVisibilityMode"] = setting.Service.DefaultUserVisibilityMode + ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice() sources, err := auth.Sources() if err != nil { @@ -273,6 +274,7 @@ func EditUserPost(ctx *context.Context) { ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminUsers"] = true ctx.Data["DisableMigrations"] = setting.Repository.DisableMigrations + ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice() u := prepareUserInfo(ctx) if ctx.Written() { |