﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18526	{% with %} template tag shows strange behaviour if TEMPLATE_STRING_IF_INVALID is non-empty.	Gregor Müllegger	nobody	"The value that should be assigned to a new one using the '''with''' template tag breaks if the value is not existend. It uses the value from TEMPLATE_STRING_IF_INVALID to set the new one. But this might break template code in unexpected ways since this usually non-existend variable now evaluates as True in an if statement.

See the following snippet:

{{{
# in settings.py
TEMPLATE_STRING_IF_INVALID = '<INVALID>'
}}}

{{{
In [16]: Template('{% with not_exist as value %}{% if value %}Hello {{ value }}{% endif %}{% endwith %}').render(Context())
Out[16]: u'Hello &lt;INVALID&gt;'
}}}"	Bug	closed	Template system	dev	Normal	wontfix	with TEMPLATE_STRING_IF_INVALID	regebro	Unreviewed	0	0	0	0	0	0
