mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
remove loop part of templating code
str has __iter__ on python3 which breaks templates
This commit is contained in:
parent
15b349e3a8
commit
f6f9b767c0
1 changed files with 0 additions and 5 deletions
|
@ -97,13 +97,8 @@ class Template(object):
|
||||||
it = get_or_attr(context, section_name, None)
|
it = get_or_attr(context, section_name, None)
|
||||||
|
|
||||||
replacer = ''
|
replacer = ''
|
||||||
# if it and isinstance(it, collections.Callable):
|
|
||||||
# replacer = it(inner)
|
|
||||||
if isinstance(it, str):
|
if isinstance(it, str):
|
||||||
it = stripHTMLMedia(it).strip()
|
it = stripHTMLMedia(it).strip()
|
||||||
if it and not hasattr(it, '__iter__'):
|
|
||||||
if section[2] != '^':
|
|
||||||
replacer = inner
|
|
||||||
elif it and hasattr(it, 'keys') and hasattr(it, '__getitem__'):
|
elif it and hasattr(it, 'keys') and hasattr(it, '__getitem__'):
|
||||||
if section[2] != '^':
|
if section[2] != '^':
|
||||||
replacer = self.render(inner, it)
|
replacer = self.render(inner, it)
|
||||||
|
|
Loading…
Reference in a new issue