More 1.2 templating development; for legacy when_string constructs don't quote the 'in' operator

This commit is contained in:
Michael DeHaan 2013-04-12 13:29:10 -04:00
parent 85099be48f
commit 793a3d3f76

View file

@ -155,7 +155,6 @@ def check_conditional(conditional):
if not isinstance(conditional, basestring):
return conditional
try:
conditional = conditional.replace("\n", "\\n")
result = safe_eval(conditional)
@ -606,7 +605,7 @@ def compile_when_to_only_if(expression):
# casting is really not needed
#tcopy[i] = "%s('''%s''')" % (cast, t)
t2 = t.strip()
if (t2[0].isalpha() or t2[0] == '$') and cast == 'str':
if (t2[0].isalpha() or t2[0] == '$') and cast == 'str' and t2 != 'in':
tcopy[i] = "'%s'" % (t)
else:
tcopy[i] = t