Commit de9f7d41 by Yuest Wang

Inverted Sections For Empty List

parent feb339da
......@@ -89,7 +89,7 @@ class Template(object):
elif it and hasattr(it, 'keys') and hasattr(it, '__getitem__'):
if section[2] != '^':
replacer = self.render(inner, it)
elif it:
elif it and section[2] != '^':
insides = []
for item in it:
insides.append(self.render(inner, item))
......@@ -154,4 +154,4 @@ class Template(object):
"""Changes the Mustache delimiter."""
self.otag, self.ctag = tag_name.split(' ')
self.compile_regexps()
return ''
\ No newline at end of file
return ''
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment