Backport #26198 by @CaiCandong As title Before: ![image](https://github.com/go-gitea/gitea/assets/50507092/94afc3bf-5597-4151-a59b-5632840ffa21) After: ![image](https://github.com/go-gitea/gitea/assets/50507092/df81aa0b-98a6-477d-a270-2e45b3dca0fc) fix #26189 Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com> (cherry picked from commit 352a495c02e079e3b9ee0018dea937e7ccc5692e)
This commit is contained in:
parent
06c45d3b6e
commit
ef46b01168
1 changed files with 8 additions and 2 deletions
|
@ -514,6 +514,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,
|
||||||
|
@ -529,7 +535,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)
|
||||||
|
@ -552,7 +558,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…
Reference in a new issue