summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorJohn Olheiser <42128690+jolheiser@users.noreply.github.com>2019-02-21 14:42:54 -0600
committertechknowlogick <matti@mdranta.net>2019-02-21 15:42:54 -0500
commit994b1be9d12cb5c100ab15091bf5e5856aa38ad3 (patch)
treebd55e40b285098f9335ac16430622e49b1cca60f /models
parent477ef462510d69a8a31e008fb6e64059dc6cc148 (diff)
downloadgitea-994b1be9d12cb5c100ab15091bf5e5856aa38ad3.tar.gz
gitea-994b1be9d12cb5c100ab15091bf5e5856aa38ad3.zip
Admins can now do unlimited page size user search (listAllUsers & listAllOrgs) (#6143)
Non-admins will default to 10 page size
Diffstat (limited to 'models')
-rw-r--r--models/user.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 3fb1c3b59e..d01a29c894 100644
--- a/models/user.go
+++ b/models/user.go
@@ -1433,6 +1433,9 @@ func SearchUsers(opts *SearchUserOptions) (users []*User, _ int64, _ error) {
if opts.PageSize > 0 {
sess = sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize)
}
+ if opts.PageSize == -1 {
+ opts.PageSize = int(count)
+ }
users = make([]*User, 0, opts.PageSize)
return users, count, sess.OrderBy(opts.OrderBy.String()).Find(&users)