diff options
author | luxagraf <sng@luxagraf.net> | 2013-04-23 22:18:04 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2013-04-23 22:18:04 -0400 |
commit | 33cf5ef19cd578fcbc5962764d72bbd7310bfb89 (patch) | |
tree | a84907902337b626be85e644633681c538c74e05 /app/lib/pagination | |
parent | 4b963b007e47feedce22938c0831d0f3bcf54f84 (diff) |
swtiched from google maps api to OSM with leaflet
Diffstat (limited to 'app/lib/pagination')
-rw-r--r-- | app/lib/pagination/templatetags/pagination_tags.py | 6 | ||||
-rw-r--r-- | app/lib/pagination/tests.py | 2 |
2 files changed, 5 insertions, 3 deletions
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<div class="pagination">... >>> t.render(Context({'var': range(21), 'request': RequestProxy()})) u'\\n<div class="pagination">... >>> -"""
\ No newline at end of file +""" |