mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 05:02:42 +01:00
bug fixed on issues and pulls
This commit is contained in:
parent
cf47532ebc
commit
9c645b54dc
2 changed files with 21 additions and 9 deletions
|
@ -657,7 +657,6 @@ func (env *accessibleReposEnv) Repos(page, pageSize int) ([]*Repository, error)
|
|||
}
|
||||
|
||||
repos := make([]*Repository, 0, len(repoIDs))
|
||||
|
||||
if len(repoIDs) <= 0 {
|
||||
return repos, nil
|
||||
}
|
||||
|
|
|
@ -227,13 +227,6 @@ func Issues(ctx *context.Context) {
|
|||
ctx.Handle(500, "GetRepositories", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if err := ctxUser.GetRepositories(1, ctx.User.NumRepos); err != nil {
|
||||
ctx.Handle(500, "GetRepositories", err)
|
||||
return
|
||||
}
|
||||
repos = ctxUser.Repos
|
||||
}
|
||||
|
||||
for _, repo := range repos {
|
||||
if (isPullList && repo.NumPulls == 0) ||
|
||||
|
@ -245,6 +238,26 @@ func Issues(ctx *context.Context) {
|
|||
userRepoIDs = append(userRepoIDs, repo.ID)
|
||||
}
|
||||
|
||||
if len(userRepoIDs) <= 0 {
|
||||
userRepoIDs = []int64{-1}
|
||||
}
|
||||
|
||||
} else {
|
||||
if err := ctxUser.GetRepositories(1, ctx.User.NumRepos); err != nil {
|
||||
ctx.Handle(500, "GetRepositories", err)
|
||||
return
|
||||
}
|
||||
repos = ctxUser.Repos
|
||||
|
||||
for _, repo := range repos {
|
||||
if (isPullList && repo.NumPulls == 0) ||
|
||||
(!isPullList &&
|
||||
(!repo.EnableUnit(models.UnitTypeIssues) || repo.NumIssues == 0)) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var issues []*models.Issue
|
||||
switch filterMode {
|
||||
case models.FilterModeAll:
|
||||
|
|
Loading…
Reference in a new issue