diff options
author | 6543 <6543@obermui.de> | 2020-04-21 23:21:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 22:21:46 +0100 |
commit | 49f8b20570a4a6e7d49f00ee91453dc8ef84f4b1 (patch) | |
tree | d4ca8a6a8675fa2ef76750a5de40a91f54dd28a6 /models | |
parent | dfca884b157539ba68c713a6166cc96c45502538 (diff) | |
download | gitea-49f8b20570a4a6e7d49f00ee91453dc8ef84f4b1.tar.gz gitea-49f8b20570a4a6e7d49f00ee91453dc8ef84f4b1.zip |
make pagination optional for notifications (#10714)
Diffstat (limited to 'models')
-rw-r--r-- | models/notification.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/models/notification.go b/models/notification.go index 8d74ac129f..d0315ab051 100644 --- a/models/notification.go +++ b/models/notification.go @@ -103,7 +103,11 @@ func (opts *FindNotificationOptions) ToCond() builder.Cond { // ToSession will convert the given options to a xorm Session by using the conditions from ToCond and joining with issue table if required func (opts *FindNotificationOptions) ToSession(e Engine) *xorm.Session { - return opts.setSessionPagination(e.Where(opts.ToCond())) + sess := e.Where(opts.ToCond()) + if opts.Page != 0 { + sess = opts.setSessionPagination(sess) + } + return sess } func getNotifications(e Engine, options FindNotificationOptions) (nl NotificationList, err error) { |