summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-26 15:32:53 +0800
committerGitHub <noreply@github.com>2020-01-26 15:32:53 +0800
commit8d51f28ba04980734a04fef645a8065472e6ca63 (patch)
tree80a3c6887082354aa4b1e2337191cabf71c142de
parent59510d6227962a455c8276a5f3330215fb67f747 (diff)
downloadgitea-8d51f28ba04980734a04fef645a8065472e6ca63.tar.gz
gitea-8d51f28ba04980734a04fef645a8065472e6ca63.zip
Fix wrong paging on org members (#9990)
-rw-r--r--models/list_options.go2
-rw-r--r--routers/org/members.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/models/list_options.go b/models/list_options.go
index 91c4298c85..c49b83d1ff 100644
--- a/models/list_options.go
+++ b/models/list_options.go
@@ -13,7 +13,7 @@ import (
// ListOptions options to paginate results
type ListOptions struct {
PageSize int
- Page int
+ Page int // start from 1
}
func (opts ListOptions) getPaginatedSession() *xorm.Session {
diff --git a/routers/org/members.go b/routers/org/members.go
index 053bd21f5e..9f13d1be3f 100644
--- a/routers/org/members.go
+++ b/routers/org/members.go
@@ -52,7 +52,7 @@ func Members(ctx *context.Context) {
}
pager := context.NewPagination(int(total), setting.UI.MembersPagingNum, page, 5)
- opts.ListOptions.Page = (page - 1) * setting.UI.MembersPagingNum
+ opts.ListOptions.Page = page
opts.ListOptions.PageSize = setting.UI.MembersPagingNum
members, membersIsPublic, err := models.FindOrgMembers(&opts)
if err != nil {