|
|
@ -162,7 +162,7 @@ class Templar:
|
|
|
|
result = self._do_template(variable, preserve_trailing_newlines=preserve_trailing_newlines, fail_on_undefined=fail_on_undefined, overrides=overrides)
|
|
|
|
result = self._do_template(variable, preserve_trailing_newlines=preserve_trailing_newlines, fail_on_undefined=fail_on_undefined, overrides=overrides)
|
|
|
|
|
|
|
|
|
|
|
|
# if this looks like a dictionary or list, convert it to such using the safe_eval method
|
|
|
|
# if this looks like a dictionary or list, convert it to such using the safe_eval method
|
|
|
|
if (result.startswith("{") and not result.startswith(self.environment.variable_start_string)) or result.startswith("["):
|
|
|
|
if (result.startswith("{") and not result.startswith(self.environment.variable_start_string)) or result.startswith("[") or result in ("True", "False"):
|
|
|
|
eval_results = safe_eval(result, locals=self._available_variables, include_exceptions=True)
|
|
|
|
eval_results = safe_eval(result, locals=self._available_variables, include_exceptions=True)
|
|
|
|
if eval_results[1] is None:
|
|
|
|
if eval_results[1] is None:
|
|
|
|
result = eval_results[0]
|
|
|
|
result = eval_results[0]
|
|
|
|