Skip to content

Commit fd836ff

Browse files
authored
1 parent b33cf4f commit fd836ff

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
@@ -518,6 +518,12 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.R
518518
}
519519

520520
func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
521+
// Distinguish whether the owner of the repository
522+
// is an individual or an organization
523+
repoOwnerType := project_model.TypeIndividual
524+
if repo.Owner.IsOrganization() {
525+
repoOwnerType = project_model.TypeOrganization
526+
}
521527
var err error
522528
projects, _, err := project_model.FindProjects(ctx, project_model.SearchOptions{
523529
RepoID: repo.ID,
@@ -533,7 +539,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
533539
OwnerID: repo.OwnerID,
534540
Page: -1,
535541
IsClosed: util.OptionalBoolFalse,
536-
Type: project_model.TypeOrganization,
542+
Type: repoOwnerType,
537543
})
538544
if err != nil {
539545
ctx.ServerError("GetProjects", err)
@@ -556,7 +562,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
556562
OwnerID: repo.OwnerID,
557563
Page: -1,
558564
IsClosed: util.OptionalBoolTrue,
559-
Type: project_model.TypeOrganization,
565+
Type: repoOwnerType,
560566
})
561567
if err != nil {
562568
ctx.ServerError("GetProjects", err)

0 commit comments

Comments
 (0)