aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeripath2022-03-10 06:48:27 +0000
committerGitHub2022-03-10 01:48:27 -0500
commit4047c5c068b80b66e0e61247ec239dc388615a02 (patch)
tree4e84b9e95f88c4e0ace3f1b7546c9263e8fa4956
parent03d924238c3cf56ffba640356d6657f3a9e6142d (diff)
Ignore missing comment for user notifications (#18954) (#19043)
-rw-r--r--models/notification.go7
-rw-r--r--routers/api/v1/notify/repo.go2
2 files changed, 5 insertions, 4 deletions
diff --git a/models/notification.go b/models/notification.go
index 8f5d9d01e..b53d236e4 100644
--- a/models/notification.go
+++ b/models/notification.go
@@ -498,14 +498,15 @@ func (n *Notification) APIURL() string {
type NotificationList []*Notification
// LoadAttributes load Repo Issue User and Comment if not loaded
-func (nl NotificationList) LoadAttributes() (err error) {
+func (nl NotificationList) LoadAttributes() error {
+ var err error
for i := 0; i < len(nl); i++ {
err = nl[i].LoadAttributes()
if err != nil && !IsErrCommentNotExist(err) {
- return
+ return err
}
}
- return
+ return nil
}
func (nl NotificationList) getPendingRepoIDs() []int64 {
diff --git a/routers/api/v1/notify/repo.go b/routers/api/v1/notify/repo.go
index 8bf5d3711..30357ebd3 100644
--- a/routers/api/v1/notify/repo.go
+++ b/routers/api/v1/notify/repo.go
@@ -121,7 +121,7 @@ func ListRepoNotifications(ctx *context.APIContext) {
return
}
err = nl.LoadAttributes()
- if err != nil && !models.IsErrCommentNotExist(err) {
+ if err != nil {
ctx.InternalServerError(err)
return
}