5 | | try: |
6 | | contacts = paginator.page(page) |
7 | | except PageNotAnInteger: |
8 | | # If page is not an integer, deliver first page. |
9 | | contacts = paginator.page(1) |
10 | | except EmptyPage: |
11 | | # If page is out of range (e.g. 9999), deliver last page of results. |
12 | | contacts = paginator.page(paginator.num_pages) |
| 5 | try: |
| 6 | contacts = paginator.page(page) |
| 7 | except PageNotAnInteger: |
| 8 | # If page is not an integer, deliver first page. |
| 9 | contacts = paginator.page(1) |
| 10 | except EmptyPage: |
| 11 | # If page is out of range (e.g. 9999), deliver last page of results. |
| 12 | contacts = paginator.page(paginator.num_pages) |