Skip to content

Commit

Permalink
Fix unable to display individual-level project (go-gitea#26198)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiCandong authored and GiteaBot committed Aug 21, 2023
1 parent f43df2f commit 9666c7e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,12 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.R
}

func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
// Distinguish whether the owner of the repository
// is an individual or an organization
repoOwnerType := project_model.TypeIndividual
if repo.Owner.IsOrganization() {
repoOwnerType = project_model.TypeOrganization
}
var err error
projects, _, err := project_model.FindProjects(ctx, project_model.SearchOptions{
RepoID: repo.ID,
Expand All @@ -529,7 +535,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
OwnerID: repo.OwnerID,
Page: -1,
IsClosed: util.OptionalBoolFalse,
Type: project_model.TypeOrganization,
Type: repoOwnerType,
})
if err != nil {
ctx.ServerError("GetProjects", err)
Expand All @@ -552,7 +558,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
OwnerID: repo.OwnerID,
Page: -1,
IsClosed: util.OptionalBoolTrue,
Type: project_model.TypeOrganization,
Type: repoOwnerType,
})
if err != nil {
ctx.ServerError("GetProjects", err)
Expand Down

0 comments on commit 9666c7e

Please sign in to comment.