Revised to redirect on invalid page size and page number on pagination.

This commit is contained in:
imacat committed 2020-07-01 23:39:32 +08:00
1 parent 8cab91dcd2
commit 1ddfc96621
2 files changed
+69 -29

No files matched your search

+5 -1
View File
@@ -70,4 +70,8 @@ class Pagination:
if page_no is not None \
else 1 if not is_reverse else total_pages
if self.page_no > total_pages:
self.page_no = total_pages
raise PageNoOutOfRangeError()
class PageNoOutOfRangeError(Exception):
pass