File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 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
514514}
515515
516516func 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 )
You can’t perform that action at this time.
0 commit comments