From: Zygmunt Krynicki Date: Wed, 26 Jun 2013 14:26:41 +0000 (-0700) Subject: Merge pull request #17 from mjtorn/master X-Git-Tag: release-2.1~7 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/bfed3bceaa8244eb45f05152c94ea899be470d9e?hp=705e40c34ace623dd90dc20b09c2ac3743cb869c Merge pull request #17 from mjtorn/master Hopefully last pull request :) --- diff --git a/linaro_django_pagination/templatetags/pagination_tags.py b/linaro_django_pagination/templatetags/pagination_tags.py index a4e4fed..affdc16 100644 --- a/linaro_django_pagination/templatetags/pagination_tags.py +++ b/linaro_django_pagination/templatetags/pagination_tags.py @@ -186,7 +186,7 @@ class PaginateNode(Node): new_context = paginate(context) if self.template: template_list.insert(0, self.template) - return loader.render_to_string(template_list, new_context, + return loader.render_to_string(template_list, new_context, context_instance = context) @@ -326,10 +326,9 @@ def paginate(context, window=DEFAULT_WINDOW, margin=DEFAULT_MARGIN): new_context['getvars'] = "&%s" % getvars.urlencode() else: new_context['getvars'] = '' + return new_context except (KeyError, AttributeError): - new_context = {} - - context.update(new_context) + pass return context diff --git a/linaro_django_pagination/test_project/settings.py b/linaro_django_pagination/test_project/settings.py index e0a3708..cf7ea25 100644 --- a/linaro_django_pagination/test_project/settings.py +++ b/linaro_django_pagination/test_project/settings.py @@ -48,4 +48,7 @@ locals().update( TEMPLATE_CONTEXT_PROCESSORS=[ # Request processor needs to be enabled 'django.core.context_processors.request'], - ROOT_URLCONF="linaro_django_pagination.test_project.urls")) + ROOT_URLCONF="linaro_django_pagination.test_project.urls"), + TEMPLATE_LOADERS = ['django.template.loaders.app_directories.Loader'], + SECRET_KEY = 'not for production', + )