diff options
author | 6543 <6543@obermui.de> | 2024-11-11 01:38:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-11 01:38:30 +0100 |
commit | 43c252dfeaf9ab03c4db3e7ac5169bc0d69901ac (patch) | |
tree | 0fdac424af8a41ad804a2f6385666e48e7f12520 /services | |
parent | b1f42a0cdddc8db9eef87041d6bcb328b2ef35fc (diff) | |
download | gitea-43c252dfeaf9ab03c4db3e7ac5169bc0d69901ac.tar.gz gitea-43c252dfeaf9ab03c4db3e7ac5169bc0d69901ac.zip |
Calculate `PublicOnly` for org membership only once (#32234)
Refactoring of #32211
this move the PublicOnly() filter calcuation next to the DB querys and
let it be decided by the Doer
---
*Sponsored by Kithara Software GmbH*
Diffstat (limited to 'services')
-rw-r--r-- | services/context/org.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/services/context/org.go b/services/context/org.go index 7eba80ff96..e420629372 100644 --- a/services/context/org.go +++ b/services/context/org.go @@ -26,7 +26,6 @@ type Organization struct { Organization *organization.Organization OrgLink string CanCreateOrgRepo bool - PublicMemberOnly bool // Only display public members Team *organization.Team Teams []*organization.Team @@ -176,10 +175,10 @@ func HandleOrgAssignment(ctx *Context, args ...bool) { ctx.Data["OrgLink"] = ctx.Org.OrgLink // Member - ctx.Org.PublicMemberOnly = ctx.Doer == nil || !ctx.Org.IsMember && !ctx.Doer.IsAdmin opts := &organization.FindOrgMembersOpts{ - OrgID: org.ID, - PublicOnly: ctx.Org.PublicMemberOnly, + Doer: ctx.Doer, + OrgID: org.ID, + IsDoerMember: ctx.Org.IsMember, } ctx.Data["NumMembers"], err = organization.CountOrgMembers(ctx, opts) if err != nil { |