File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -514,6 +514,12 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.R
514
514
}
515
515
516
516
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
+ }
517
523
var err error
518
524
projects , _ , err := project_model .FindProjects (ctx , project_model.SearchOptions {
519
525
RepoID : repo .ID ,
@@ -529,7 +535,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
529
535
OwnerID : repo .OwnerID ,
530
536
Page : - 1 ,
531
537
IsClosed : util .OptionalBoolFalse ,
532
- Type : project_model . TypeOrganization ,
538
+ Type : repoOwnerType ,
533
539
})
534
540
if err != nil {
535
541
ctx .ServerError ("GetProjects" , err )
@@ -552,7 +558,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
552
558
OwnerID : repo .OwnerID ,
553
559
Page : - 1 ,
554
560
IsClosed : util .OptionalBoolTrue ,
555
- Type : project_model . TypeOrganization ,
561
+ Type : repoOwnerType ,
556
562
})
557
563
if err != nil {
558
564
ctx .ServerError ("GetProjects" , err )
You can’t perform that action at this time.
0 commit comments