summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-23 09:49:58 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-23 09:49:58 +0000
commitbd4c22be0b7c75ef8b6a1e623fdc2626f05ea194 (patch)
tree95bd96fd11c3deadb53b5a0aa9d542948d42cfca /django
parent670e8ab7040b3cb1f04d72a76b2c1fc9a4b3f457 (diff)
Fixed #2454 -- Make "ifchanged" tag work more predictably inside nested
for-loops. Thanks, dummy@habmalnefrage.de. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3800 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/template/defaulttags.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index daf7f41a85..07e579bf9d 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -129,6 +129,8 @@ class IfChangedNode(Node):
self._last_seen = None
def render(self, context):
+ if context.has_key('forloop') and context['forloop']['first']:
+ self._last_seen = None
content = self.nodelist.render(context)
if content != self._last_seen:
firstloop = (self._last_seen == None)