From c09eab54859f34247b9cf9278fa322f9ecfc6afa Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Fri, 31 Mar 2023 01:29:57 +0900 Subject: [PATCH] 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 --- routers/web/admin/users.go | 2 ++ 1 file changed, 2 insertions(+) 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() {