mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: per-page needs to be non zero
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
This commit is contained in:
parent
cb16f42a27
commit
45218c4ce7
2 changed files with 2 additions and 1 deletions
|
@ -103,7 +103,7 @@ def sanitize_params(offset_str: str, per_page_str: str) -> Tuple[int, int]:
|
||||||
offset = defaults.O
|
offset = defaults.O
|
||||||
|
|
||||||
try:
|
try:
|
||||||
per_page = defaults.PP if int(per_page_str) < 0 else int(per_page_str)
|
per_page = defaults.PP if int(per_page_str) <= 0 else int(per_page_str)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
per_page = defaults.PP
|
per_page = defaults.PP
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,7 @@ fRSo6OFcejKc=
|
||||||
("", "", (0, 50)),
|
("", "", (0, 50)),
|
||||||
("-1", "100", (0, 100)),
|
("-1", "100", (0, 100)),
|
||||||
("5", "-100", (5, 50)),
|
("5", "-100", (5, 50)),
|
||||||
|
("0", "0", (0, 50)),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_sanitize_params(offset_str: str, per_page_str: str, expected: tuple[int, int]):
|
def test_sanitize_params(offset_str: str, per_page_str: str, expected: tuple[int, int]):
|
||||||
|
|
Loading…
Add table
Reference in a new issue