mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-16 15:02:43 +00:00
Strict pagination check (#32548)
(cherry picked from commit c363bd06e93986a564601527ade219d602c9d8dd)
Conflicts:
models/user/search.go
change already done in 9b85f97835
This commit is contained in:
parent
7bc6bd3095
commit
3135e146f9
8 changed files with 10 additions and 10 deletions
|
@ -339,7 +339,7 @@ func GetUserFollowers(ctx context.Context, u, viewer *User, listOptions db.ListO
|
|||
And("`user`.type=?", UserTypeIndividual).
|
||||
And(isUserVisibleToViewerCond(viewer))
|
||||
|
||||
if listOptions.Page != 0 {
|
||||
if listOptions.Page > 0 {
|
||||
sess = db.SetSessionPagination(sess, &listOptions)
|
||||
|
||||
users := make([]*User, 0, listOptions.PageSize)
|
||||
|
@ -361,7 +361,7 @@ func GetUserFollowing(ctx context.Context, u, viewer *User, listOptions db.ListO
|
|||
And("`user`.type IN (?, ?)", UserTypeIndividual, UserTypeOrganization).
|
||||
And(isUserVisibleToViewerCond(viewer))
|
||||
|
||||
if listOptions.Page != 0 {
|
||||
if listOptions.Page > 0 {
|
||||
sess = db.SetSessionPagination(sess, &listOptions)
|
||||
|
||||
users := make([]*User, 0, listOptions.PageSize)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue