﻿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
13672	template cache tag should gracefully handle uninitialized variables	nbv4	nobody	"I keep running into this problem. I have a page that uses the template cache tag. One of the variables that gets used as a cache key is sometimes available in the context, sometimes not (it's added to the context via middleware).

If the variable is not initialized, the whole page fails to render. EX:

--------
context:

{key1: 'value', key2: 'another value'}

--------
template:

{% if key3 %}
no errors are thrown here
{% endif %}

{% cache 1800 mycache key1 key2 key3 %}
causes a problem
{% endcache %}

--------
result:

Caught VariableDoesNotExist while rendering: Failed lookup for key [key3] in u""[{'key1: 'value', key2: 'another value'}]""

I think it would be best to just have the key be ""None"" if it's uninitialized instead of throwing an error."		closed	Uncategorized	dev		duplicate	template cache		Unreviewed	0	0	0	0	0	0
