﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28843	Pagination: previous_page_number shouldn't raise exception when page=1	Scot Hacker	nobody	"According to Django 2.0 docs:
https://docs.djangoproject.com/en/2.0/topics/pagination/

It should be possible to use:

{{{
<a href=""?page={{ contacts.previous_page_number }}"">previous</a>
}}}

But if you're looking at /contacts/?page=1 ,  or /contacts, then previous_page_number() resolves to 0, which throws an exception. It's not even possible to use 
{{{
{% if contacts.previous_page_number %}
}}}

as it raises the same error. It seems that this method causes a site crash when on page 1, no matter what.

Propose: previous_page_number should return 0 if it can't go any further back rather than raise an exception.

Related to:
https://code.djangoproject.com/ticket/17159
"	Uncategorized	closed	Uncategorized	2.0	Normal	invalid	pagination		Unreviewed	0	0	0	0	0	0
