From dac4fbcc2140f7c4f51ad4f70806e72608a6aae2 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 18 Apr 2020 02:50:40 +0200 Subject: [PATCH] make pagination optional for notificatins --- models/notification.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/notification.go b/models/notification.go index 8d74ac129f01e..d0315ab051d05 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) {