You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.
try:
page_obj=paginator.page(request.page(page_suffix))
exceptInvalidPage:
ifINVALID_PAGE_RAISES_404:
raiseHttp404(
"Invalid page requested. If DEBUG were set to "+"False, an HTTP 404 page would have been shown instead."
)
ifSHOW_FIRST_PAGE_WHEN_INVALID# fallback to first pagepage_obj=paginator.page(1)
else:
context[key] = []
context["invalid_page"] =Truereturn""
The text was updated successfully, but these errors were encountered:
It would be very useful to have an option to default to the first page if hitting a wrong page object.
I suggest to basically replace https://github.com/pydanny/dj-pagination/blob/master/dj_pagination/templatetags/pagination_tags.py#L186-L196 with something like this:
The text was updated successfully, but these errors were encountered: