Revert "Context is updated, return it. Also avoid recursion error."
authorMarkus Törnqvist <mjt@fadconsulting.com>
Wed, 26 Jun 2013 12:56:53 +0000 (15:56 +0300)
committerMarkus Törnqvist <mjt@fadconsulting.com>
Wed, 26 Jun 2013 12:56:53 +0000 (15:56 +0300)
This reverts commit 12fa5deb8220b12e21b44524751cc515796bf219.

linaro_django_pagination/templatetags/pagination_tags.py

index 1577452..a4e4fed 100644 (file)
@@ -186,7 +186,7 @@ class PaginateNode(Node):
         new_context = paginate(context)
         if self.template:
             template_list.insert(0, self.template)
         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)
 
 
             context_instance = context)
 
 
@@ -326,11 +326,12 @@ def paginate(context, window=DEFAULT_WINDOW, margin=DEFAULT_MARGIN):
                 new_context['getvars'] = "&%s" % getvars.urlencode()
             else:
                 new_context['getvars'] = ''
                 new_context['getvars'] = "&%s" % getvars.urlencode()
             else:
                 new_context['getvars'] = ''
+    except (KeyError, AttributeError):
+        new_context = {}
 
 
-        context.update(new_context)
+    context.update(new_context)
 
 
-    except (KeyError, AttributeError):
-        pass
+    return context
 
 
 register = Library()
 
 
 register = Library()