Template config validator should not allow dictionaries

pull/2776/head
Paulus Schoutsen 2016-08-09 20:58:27 -07:00
parent 6dc49ff123
commit e773526714
1 changed files with 2 additions and 0 deletions

View File

@ -239,6 +239,8 @@ def template(value):
"""Validate a jinja2 template.""" """Validate a jinja2 template."""
if value is None: if value is None:
raise vol.Invalid('template value is None') raise vol.Invalid('template value is None')
if isinstance(value, (list, dict)):
raise vol.Invalid('template value should be a string')
value = str(value) value = str(value)
try: try: