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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user