Skip to content

Commit 352a495

Browse files
GiteaBotCaiCandong
andauthored
1 parent a4b1463 commit 352a495

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

routers/web/repo/issue.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,12 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.R
514514
}
515515

516516
func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
517+
// Distinguish whether the owner of the repository
518+
// is an individual or an organization
519+
repoOwnerType := project_model.TypeIndividual
520+
if repo.Owner.IsOrganization() {
521+
repoOwnerType = project_model.TypeOrganization
522+
}
517523
var err error
518524
projects, _, err := project_model.FindProjects(ctx, project_model.SearchOptions{
519525
RepoID: repo.ID,
@@ -529,7 +535,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
529535
OwnerID: repo.OwnerID,
530536
Page: -1,
531537
IsClosed: util.OptionalBoolFalse,
532-
Type: project_model.TypeOrganization,
538+
Type: repoOwnerType,
533539
})
534540
if err != nil {
535541
ctx.ServerError("GetProjects", err)
@@ -552,7 +558,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
552558
OwnerID: repo.OwnerID,
553559
Page: -1,
554560
IsClosed: util.OptionalBoolTrue,
555-
Type: project_model.TypeOrganization,
561+
Type: repoOwnerType,
556562
})
557563
if err != nil {
558564
ctx.ServerError("GetProjects", err)

0 commit comments

Comments
 (0)