1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #6322 -- Fixed bug in 'ifchanged' template tag where it wasn't resetting itself properly in some cases. Thanks, nedbatchelder

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2008-06-26 04:30:06 +00:00
parent 65437a95e1
commit dbde7fc8b0
2 changed files with 6 additions and 4 deletions

View File

@@ -162,10 +162,12 @@ class IfChangedNode(Node):
self.nodelist = nodelist
self._last_seen = None
self._varlist = map(Variable, varlist)
self._id = str(id(self))
def render(self, context):
if 'forloop' in context and context['forloop']['first']:
if 'forloop' in context and self._id not in context['forloop']:
self._last_seen = None
context['forloop'][self._id] = 1
try:
if self._varlist:
# Consider multiple parameters. This automatically behaves