Strict pagination check (#32548)

(cherry picked from commit c363bd06e93986a564601527ade219d602c9d8dd)

Conflicts:
	models/user/search.go
  change already done in 9b85f97835
This commit is contained in:
Lunny Xiao 2024-11-24 17:56:50 -08:00 committed by Earl Warren
parent 7bc6bd3095
commit 3135e146f9
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
8 changed files with 10 additions and 10 deletions

View file

@ -394,7 +394,7 @@ func GetLabelsByRepoID(ctx context.Context, repoID int64, sortType string, listO
sess.Asc("name")
}
if listOptions.Page != 0 {
if listOptions.Page > 0 {
sess = db.SetSessionPagination(sess, &listOptions)
}
@ -466,7 +466,7 @@ func GetLabelsByOrgID(ctx context.Context, orgID int64, sortType string, listOpt
sess.Asc("name")
}
if listOptions.Page != 0 {
if listOptions.Page > 0 {
sess = db.SetSessionPagination(sess, &listOptions)
}