Commit b09f1f8e by James Cammarata

Account for filters in bare variable conversion

Fixes #11530
parent ae54792a
...@@ -211,8 +211,9 @@ class Templar: ...@@ -211,8 +211,9 @@ class Templar:
''' '''
if isinstance(variable, basestring): if isinstance(variable, basestring):
first_part = variable.split(".")[0].split("[")[0] contains_filters = "|" in variable
if first_part in self._available_variables and self.environment.variable_start_string not 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) 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, # the variable didn't meet the conditions to be converted,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment