diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-03-22 08:03:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-22 15:03:22 +0800 |
commit | 80fd25524e13dedbdc3527b32d008de152213a89 (patch) | |
tree | 63b2bfe4ffaf1dce12080cabdc2e845c8731a673 /routers/web/org/home.go | |
parent | 5495ba7660979973ba19e304786135da474e0e64 (diff) | |
download | gitea-80fd25524e13dedbdc3527b32d008de152213a89.tar.gz gitea-80fd25524e13dedbdc3527b32d008de152213a89.zip |
Renamed ctx.User to ctx.Doer. (#19161)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/web/org/home.go')
-rw-r--r-- | routers/web/org/home.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/web/org/home.go b/routers/web/org/home.go index fc81ceb719..1466731b9e 100644 --- a/routers/web/org/home.go +++ b/routers/web/org/home.go @@ -39,7 +39,7 @@ func Home(ctx *context.Context) { org := ctx.Org.Organization - if !models.HasOrgOrUserVisible(org.AsUser(), ctx.User) { + if !models.HasOrgOrUserVisible(org.AsUser(), ctx.Doer) { ctx.NotFound("HasOrgOrUserVisible", nil) return } @@ -113,7 +113,7 @@ func Home(ctx *context.Context) { OwnerID: org.ID, OrderBy: orderBy, Private: ctx.IsSigned, - Actor: ctx.User, + Actor: ctx.Doer, Language: language, IncludeDescription: setting.UI.SearchRepoDescription, }) @@ -128,13 +128,13 @@ func Home(ctx *context.Context) { ListOptions: db.ListOptions{Page: 1, PageSize: 25}, } - if ctx.User != nil { - isMember, err := org.IsOrgMember(ctx.User.ID) + if ctx.Doer != nil { + isMember, err := org.IsOrgMember(ctx.Doer.ID) if err != nil { ctx.Error(http.StatusInternalServerError, "IsOrgMember") return } - opts.PublicOnly = !isMember && !ctx.User.IsAdmin + opts.PublicOnly = !isMember && !ctx.Doer.IsAdmin } members, _, err := models.FindOrgMembers(opts) |