From 8d51f28ba04980734a04fef645a8065472e6ca63 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 26 Jan 2020 15:32:53 +0800 Subject: [PATCH] Fix wrong paging on org members (#9990) --- models/list_options.go | 2 +- routers/org/members.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/list_options.go b/models/list_options.go index 91c4298c858..c49b83d1fff 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 053bd21f5e1..9f13d1be3f7 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 {