mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 14:31:02 +00:00 
			
		
		
		
	Fix unable to display individual-level project (#26198)
As title Before:  After:  fix #26189
This commit is contained in:
		
					parent
					
						
							
								b33cf4fabc
							
						
					
				
			
			
				commit
				
					
						fd836ff68b
					
				
			
		
					 1 changed files with 8 additions and 2 deletions
				
			
		|  | @ -518,6 +518,12 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.R | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) { | func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) { | ||||||
|  | 	// Distinguish whether the owner of the repository | ||||||
|  | 	// is an individual or an organization | ||||||
|  | 	repoOwnerType := project_model.TypeIndividual | ||||||
|  | 	if repo.Owner.IsOrganization() { | ||||||
|  | 		repoOwnerType = project_model.TypeOrganization | ||||||
|  | 	} | ||||||
| 	var err error | 	var err error | ||||||
| 	projects, _, err := project_model.FindProjects(ctx, project_model.SearchOptions{ | 	projects, _, err := project_model.FindProjects(ctx, project_model.SearchOptions{ | ||||||
| 		RepoID:   repo.ID, | 		RepoID:   repo.ID, | ||||||
|  | @ -533,7 +539,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) { | ||||||
| 		OwnerID:  repo.OwnerID, | 		OwnerID:  repo.OwnerID, | ||||||
| 		Page:     -1, | 		Page:     -1, | ||||||
| 		IsClosed: util.OptionalBoolFalse, | 		IsClosed: util.OptionalBoolFalse, | ||||||
| 		Type:     project_model.TypeOrganization, | 		Type:     repoOwnerType, | ||||||
| 	}) | 	}) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		ctx.ServerError("GetProjects", err) | 		ctx.ServerError("GetProjects", err) | ||||||
|  | @ -556,7 +562,7 @@ func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) { | ||||||
| 		OwnerID:  repo.OwnerID, | 		OwnerID:  repo.OwnerID, | ||||||
| 		Page:     -1, | 		Page:     -1, | ||||||
| 		IsClosed: util.OptionalBoolTrue, | 		IsClosed: util.OptionalBoolTrue, | ||||||
| 		Type:     project_model.TypeOrganization, | 		Type:     repoOwnerType, | ||||||
| 	}) | 	}) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		ctx.ServerError("GetProjects", err) | 		ctx.ServerError("GetProjects", err) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue