1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 12:54:53 -05:00

Fix wrong paging on org members (#9990)

This commit is contained in:
Lunny Xiao 2020-01-26 15:32:53 +08:00 committed by GitHub
parent 59510d6227
commit 8d51f28ba0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ import (
// ListOptions options to paginate results // ListOptions options to paginate results
type ListOptions struct { type ListOptions struct {
PageSize int PageSize int
Page int Page int // start from 1
} }
func (opts ListOptions) getPaginatedSession() *xorm.Session { func (opts ListOptions) getPaginatedSession() *xorm.Session {

View file

@ -52,7 +52,7 @@ func Members(ctx *context.Context) {
} }
pager := context.NewPagination(int(total), setting.UI.MembersPagingNum, page, 5) 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 opts.ListOptions.PageSize = setting.UI.MembersPagingNum
members, membersIsPublic, err := models.FindOrgMembers(&opts) members, membersIsPublic, err := models.FindOrgMembers(&opts)
if err != nil { if err != nil {