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 @@ -518,6 +518,12 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.R
518
518
}
519
519
520
520
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
+ }
521
527
var err error
522
528
projects , _ , err := project_model .FindProjects (ctx , project_model.SearchOptions {
523
529
RepoID : repo .ID ,
@@ -533,7 +539,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
533
539
OwnerID : repo .OwnerID ,
534
540
Page : - 1 ,
535
541
IsClosed : util .OptionalBoolFalse ,
536
- Type : project_model . TypeOrganization ,
542
+ Type : repoOwnerType ,
537
543
})
538
544
if err != nil {
539
545
ctx .ServerError ("GetProjects" , err )
@@ -556,7 +562,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
556
562
OwnerID : repo .OwnerID ,
557
563
Page : - 1 ,
558
564
IsClosed : util .OptionalBoolTrue ,
559
- Type : project_model . TypeOrganization ,
565
+ Type : repoOwnerType ,
560
566
})
561
567
if err != nil {
562
568
ctx .ServerError ("GetProjects" , err )
You can’t perform that action at this time.
0 commit comments