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/members.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/members.go')
-rw-r--r-- | routers/web/org/members.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/web/org/members.go b/routers/web/org/members.go index b8e7fa1ff5..9e65e61404 100644 --- a/routers/web/org/members.go +++ b/routers/web/org/members.go @@ -36,13 +36,13 @@ func Members(ctx *context.Context) { PublicOnly: true, } - if ctx.User != nil { - isMember, err := ctx.Org.Organization.IsOrgMember(ctx.User.ID) + if ctx.Doer != nil { + isMember, err := ctx.Org.Organization.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 } total, err := models.CountOrgMembers(opts) @@ -80,13 +80,13 @@ func MembersAction(ctx *context.Context) { var err error switch ctx.Params(":action") { case "private": - if ctx.User.ID != uid && !ctx.Org.IsOwner { + if ctx.Doer.ID != uid && !ctx.Org.IsOwner { ctx.Error(http.StatusNotFound) return } err = models.ChangeOrgUserStatus(org.ID, uid, false) case "public": - if ctx.User.ID != uid && !ctx.Org.IsOwner { + if ctx.Doer.ID != uid && !ctx.Org.IsOwner { ctx.Error(http.StatusNotFound) return } @@ -105,7 +105,7 @@ func MembersAction(ctx *context.Context) { return } case "leave": - err = org.RemoveMember(ctx.User.ID) + err = org.RemoveMember(ctx.Doer.ID) if models.IsErrLastOrgOwner(err) { ctx.Flash.Error(ctx.Tr("form.last_org_owner")) ctx.JSON(http.StatusOK, map[string]interface{}{ |