diff options
author | David Schneiderbauer <daviian@users.noreply.github.com> | 2018-06-21 18:00:13 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@users.noreply.github.com> | 2018-06-21 12:00:13 -0400 |
commit | 0b3ea428477b9da33f40252e79aafe85b09526f3 (patch) | |
tree | 4fccc7dbf7f027331735d7d041bc290db632b744 /models/notification.go | |
parent | 46d19c4676efe5201c5de790bcb963bfc93a95c7 (diff) | |
download | gitea-0b3ea428477b9da33f40252e79aafe85b09526f3.tar.gz gitea-0b3ea428477b9da33f40252e79aafe85b09526f3.zip |
hide issues from org private repos w/o team assignment (#4034)
Diffstat (limited to 'models/notification.go')
-rw-r--r-- | models/notification.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/models/notification.go b/models/notification.go index c8376a857b..8c36c0c5c9 100644 --- a/models/notification.go +++ b/models/notification.go @@ -119,7 +119,17 @@ func createOrUpdateIssueNotifications(e Engine, issue *Issue, notificationAuthor } } + issue.loadRepo(e) + for _, watch := range watches { + issue.Repo.Units = nil + if issue.IsPull && !issue.Repo.CheckUnitUser(watch.UserID, false, UnitTypePullRequests) { + continue + } + if !issue.IsPull && !issue.Repo.CheckUnitUser(watch.UserID, false, UnitTypeIssues) { + continue + } + if err := notifyUser(watch.UserID); err != nil { return err } |