1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Improve notification (#8835)

* Improve notifications

* batch load user

* Update notification only when read

* Fix reorder

* fix lint

* fix test

* fix lint

* make function meaningful

* fix comment
This commit is contained in:
Lunny Xiao
2019-11-12 16:33:34 +08:00
committed by GitHub
parent 555b1f6581
commit bb6879d339
7 changed files with 299 additions and 36 deletions

View File

@@ -14,7 +14,7 @@ func TestCreateOrUpdateIssueNotifications(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
issue := AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue)
assert.NoError(t, CreateOrUpdateIssueNotifications(issue, 2))
assert.NoError(t, CreateOrUpdateIssueNotifications(issue.ID, 0, 2))
// User 9 is inactive, thus notifications for user 1 and 4 are created
notf := AssertExistsAndLoadBean(t, &Notification{UserID: 1, IssueID: issue.ID}).(*Notification)