summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorDavid Schneiderbauer <daviian@users.noreply.github.com>2018-06-21 18:00:13 +0200
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-06-21 12:00:13 -0400
commit0b3ea428477b9da33f40252e79aafe85b09526f3 (patch)
tree4fccc7dbf7f027331735d7d041bc290db632b744 /routers/user
parent46d19c4676efe5201c5de790bcb963bfc93a95c7 (diff)
downloadgitea-0b3ea428477b9da33f40252e79aafe85b09526f3.tar.gz
gitea-0b3ea428477b9da33f40252e79aafe85b09526f3.zip
hide issues from org private repos w/o team assignment (#4034)
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/home.go6
-rw-r--r--routers/user/home_test.go4
2 files changed, 7 insertions, 3 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index 2a193bbdef..0c84b2498e 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -203,7 +203,11 @@ func Issues(ctx *context.Context) {
return
}
} else {
- userRepoIDs, err = ctxUser.GetAccessRepoIDs()
+ unitType := models.UnitTypeIssues
+ if isPullList {
+ unitType = models.UnitTypePullRequests
+ }
+ userRepoIDs, err = ctxUser.GetAccessRepoIDs(unitType)
if err != nil {
ctx.ServerError("ctxUser.GetAccessRepoIDs", err)
return
diff --git a/routers/user/home_test.go b/routers/user/home_test.go
index a9b146b762..8a3d9b9f51 100644
--- a/routers/user/home_test.go
+++ b/routers/user/home_test.go
@@ -26,8 +26,8 @@ func TestIssues(t *testing.T) {
Issues(ctx)
assert.EqualValues(t, http.StatusOK, ctx.Resp.Status())
- assert.EqualValues(t, map[int64]int64{1: 1, 2: 1}, ctx.Data["Counts"])
+ assert.EqualValues(t, map[int64]int64{1: 1}, ctx.Data["Counts"])
assert.EqualValues(t, true, ctx.Data["IsShowClosed"])
assert.Len(t, ctx.Data["Issues"], 1)
- assert.Len(t, ctx.Data["Repos"], 2)
+ assert.Len(t, ctx.Data["Repos"], 1)
}