diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-15 00:02:03 +0800 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-02-15 01:17:07 +0100 |
commit | 9c645b54dcc3049a90de0c4d47c6efb0f8c1861d (patch) | |
tree | b08d9dfcc9a6e1e7152f2d0da060ad63a3af34f9 /routers | |
parent | cf47532ebc57d31d854c2ba5b7d920c3f492913f (diff) | |
download | gitea-9c645b54dcc3049a90de0c4d47c6efb0f8c1861d.tar.gz gitea-9c645b54dcc3049a90de0c4d47c6efb0f8c1861d.zip |
bug fixed on issues and pulls
Diffstat (limited to 'routers')
-rw-r--r-- | routers/user/home.go | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/routers/user/home.go b/routers/user/home.go index 00c417cb91..4aa233b477 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -227,22 +227,35 @@ func Issues(ctx *context.Context) { ctx.Handle(500, "GetRepositories", err) return } + + for _, repo := range repos { + if (isPullList && repo.NumPulls == 0) || + (!isPullList && + (!repo.EnableUnit(models.UnitTypeIssues) || repo.NumIssues == 0)) { + continue + } + + 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 + for _, repo := range repos { + if (isPullList && repo.NumPulls == 0) || + (!isPullList && + (!repo.EnableUnit(models.UnitTypeIssues) || repo.NumIssues == 0)) { + continue + } } - - userRepoIDs = append(userRepoIDs, repo.ID) } var issues []*models.Issue |