Skip updating empty dict over context
[django-pagination.git] / linaro_django_pagination / templatetags / pagination_tags.py
index 1577452..affdc16 100644 (file)
@@ -326,12 +326,12 @@ def paginate(context, window=DEFAULT_WINDOW, margin=DEFAULT_MARGIN):
                 new_context['getvars'] = "&%s" % getvars.urlencode()
             else:
                 new_context['getvars'] = ''
-
-        context.update(new_context)
-
+        return new_context
     except (KeyError, AttributeError):
         pass
 
+    return context
+
 
 register = Library()
 register.tag('paginate', do_paginate)