aboutsummaryrefslogtreecommitdiffstats
path: root/models/list_options.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/list_options.go')
-rw-r--r--models/list_options.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/list_options.go b/models/list_options.go
index c49b83d1ff..0946917fec 100644
--- a/models/list_options.go
+++ b/models/list_options.go
@@ -25,6 +25,9 @@ func (opts ListOptions) getPaginatedSession() *xorm.Session {
func (opts ListOptions) setSessionPagination(sess *xorm.Session) *xorm.Session {
opts.setDefaultValues()
+ if opts.PageSize <= 0 {
+ return sess
+ }
return sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize)
}