Commit de72703f authored by Tom van Bussel's avatar Tom van Bussel

Fix photos index view if more than 7 pages exist

parent 76c3a20b
......@@ -54,9 +54,11 @@ def index(request):
except PageNotAnInteger:
# If page is not an integer, deliver first page.
albums = paginator.page(1)
page = 1
except EmptyPage:
# If page is out of range (e.g. 9999), deliver last page of results.
albums = paginator.page(paginator.num_pages)
page = paginator.num_pages
page_range = range(1, paginator.num_pages + 1)
if paginator.num_pages > 7:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment