2
0

fix: add IsOrganizationMember check for pin to org dropdown
Some checks failed
Build and Release / Create Release (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 1m33s
Build and Release / Lint (push) Failing after 1m53s
Build and Release / Build Binaries (amd64, darwin) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin) (push) Has been skipped
Build and Release / Build Binaries (arm64, linux) (push) Has been skipped
Build and Release / Unit Tests (push) Successful in 2m0s

The pin dropdown now correctly shows the Pin to Organization option
when viewing a repo owned by an org where the user is a member.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-11 02:34:34 +00:00
parent 85d73a2d85
commit 11b2ee48e9

View File

@@ -425,6 +425,11 @@ func repoAssignment(ctx *Context, repo *repo_model.Repository) {
if ctx.Repo.Repository.Owner.IsOrganization() {
isPinnedToOrg, _ := organization.IsRepoPinned(ctx, ctx.Repo.Repository.OwnerID, ctx.Repo.Repository.ID)
ctx.Data["IsRepoPinnedToOrg"] = isPinnedToOrg
// Check if user is a member of the org for pin dropdown
if ctx.Doer != nil {
isMember, _ := organization.IsOrganizationMember(ctx, ctx.Repo.Repository.OwnerID, ctx.Doer.ID)
ctx.Data["IsOrganizationMember"] = isMember
}
}
ctx.Data["IsEmptyRepo"] = ctx.Repo.Repository.IsEmpty
}