Account for filters in bare variable conversion

Fixes #11530
This commit is contained in:
James Cammarata 2015-07-22 00:08:32 -04:00
parent ae54792a35
commit b09f1f8e0b

View file

@ -211,8 +211,9 @@ class Templar:
'''
if isinstance(variable, basestring):
first_part = variable.split(".")[0].split("[")[0]
if first_part in self._available_variables and self.environment.variable_start_string not in variable:
contains_filters = "|" in variable
first_part = variable.split("|")[0].split(".")[0].split("[")[0]
if (contains_filters or first_part in self._available_variables) and self.environment.variable_start_string not in variable:
return "%s%s%s" % (self.environment.variable_start_string, variable, self.environment.variable_end_string)
# the variable didn't meet the conditions to be converted,