diff --git a/handlers/manage-user.go b/handlers/manage-user.go index a6637d9..c23eaa9 100644 --- a/handlers/manage-user.go +++ b/handlers/manage-user.go @@ -279,11 +279,6 @@ func ViewUser() echo.HandlerFunc { ) } - ctx, ok := c.Get("sloggerCtx").(context.Context) - if !ok { - ctx = context.WithValue(context.Background(), moduser.CtxKey{}, slogger) - } - if !u.IsAdmin { c.Logger().Debug("this is a restricted endpoint") @@ -295,6 +290,11 @@ func ViewUser() echo.HandlerFunc { ) } + ctx, ok := c.Get("sloggerCtx").(context.Context) + if !ok { + ctx = context.WithValue(context.Background(), moduser.CtxKey{}, slogger) + } + p := page{ AppName: setting.AppName(), AppVer: appver,