﻿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
13167	Non-existent arg passed to template filter raises VariableDoesNotExist	Colin Copeland	nobody	"Branched from #12554.

[http://docs.djangoproject.com/en/1.1/ref/templates/api/#how-invalid-variables-are-handled How Invalid Variables Are Handled] seems to imply that if a variable doesn't exist, the template system will insert the value of the TEMPLATE_STRING_IF_INVALID setting and not raise a !VariableDoesNotExist exception. Currently, if a non-existent variable is used as an argument to a template filter, a !VariableDoesNotExist exception is raised. For example:

{{{
from django.template import Context, Template
Template('{{ foo|default:notreal }}').render(Context({'foo': ''}))
}}}

Raises: !TemplateSyntaxError: Caught !VariableDoesNotExist while rendering: Failed lookup for key [notreal] in u""[{'foo': ''}]""

I'm not sure what the proper handling should be in this case."	Bug	closed	Template system	dev	Normal	wontfix		ohmi2 iacobcatalin@…	Design decision needed	1	0	0	0	0	0
