Fix NotificationUnreadCount (#19802)

This commit is contained in:
Lunny Xiao 2022-05-25 12:38:21 +08:00 committed by GitHub
parent be99eb26a2
commit 336e1ac779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
"code.gitea.io/gitea/models" "code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"
) )
@ -35,7 +36,7 @@ func GetNotificationCount(c *context.Context) {
c.Data["NotificationUnreadCount"] = func() int64 { c.Data["NotificationUnreadCount"] = func() int64 {
count, err := models.GetNotificationCount(c.User, models.NotificationStatusUnread) count, err := models.GetNotificationCount(c.User, models.NotificationStatusUnread)
if err != nil { if err != nil {
c.ServerError("GetNotificationCount", err) log.Error("Unable to GetNotificationCount for user:%-v: %v", c.User, err)
return -1 return -1
} }