Skip to content

Commit

Permalink
bug fixed on issues and pulls
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and bkcsoft committed Feb 15, 2017
1 parent cf47532 commit 9c645b5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
1 change: 0 additions & 1 deletion models/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
29 changes: 21 additions & 8 deletions routers/user/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c645b5

Please sign in to comment.