Merge pull request #17 from mjtorn/master
authorZygmunt Krynicki <zkrynicki@gmail.com>
Wed, 26 Jun 2013 14:26:41 +0000 (07:26 -0700)
committerZygmunt Krynicki <zkrynicki@gmail.com>
Wed, 26 Jun 2013 14:26:41 +0000 (07:26 -0700)
Hopefully last pull request :)

linaro_django_pagination/templatetags/pagination_tags.py
linaro_django_pagination/test_project/settings.py

index a4e4fed..affdc16 100644 (file)
@@ -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
 
index e0a3708..cf7ea25 100644 (file)
@@ -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',
+    )