From 33cf5ef19cd578fcbc5962764d72bbd7310bfb89 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Tue, 23 Apr 2013 22:18:04 -0400 Subject: swtiched from google maps api to OSM with leaflet --- app/lib/pagination/templatetags/pagination_tags.py | 6 ++++-- app/lib/pagination/tests.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'app/lib') diff --git a/app/lib/pagination/templatetags/pagination_tags.py b/app/lib/pagination/templatetags/pagination_tags.py index ef9bf5e..dd47009 100644 --- a/app/lib/pagination/templatetags/pagination_tags.py +++ b/app/lib/pagination/templatetags/pagination_tags.py @@ -218,8 +218,10 @@ def paginate(context, window=DEFAULT_WINDOW): if 'use_page_path' in context: to_return['request'] = context['request'] to_return['use_page_path'] = context['use_page_path'] - to_return['prev_page'] = page_obj.previous_page_number() - to_return['next_page'] = page_obj.next_page_number() + if page_obj.has_previous(): + to_return['prev_page'] = page_obj.previous_page_number() + if page_obj.has_next(): + to_return['next_page'] = page_obj.next_page_number() getvars = context['request'].GET.copy() if 'page' in getvars: diff --git a/app/lib/pagination/tests.py b/app/lib/pagination/tests.py index 837e55c..ba55c03 100644 --- a/app/lib/pagination/tests.py +++ b/app/lib/pagination/tests.py @@ -49,4 +49,4 @@ u'\\n