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*
This commit is contained in:
6543 2024-11-11 01:38:30 +01:00 committed by GitHub
parent b1f42a0cdd
commit 43c252dfea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 73 additions and 54 deletions

View file

@ -95,10 +95,12 @@ func home(ctx *context.Context, viewRepositories bool) {
}
opts := &organization.FindOrgMembersOpts{
OrgID: org.ID,
PublicOnly: ctx.Org.PublicMemberOnly,
ListOptions: db.ListOptions{Page: 1, PageSize: 25},
Doer: ctx.Doer,
OrgID: org.ID,
IsDoerMember: ctx.Org.IsMember,
ListOptions: db.ListOptions{Page: 1, PageSize: 25},
}
members, _, err := organization.FindOrgMembers(ctx, opts)
if err != nil {
ctx.ServerError("FindOrgMembers", err)