浏览代码

fix Cortex, only try to template if the key exist

nico 7 年之前
父节点
当前提交
a270fcbf8f
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      kalliope/core/Cortex.py

+ 4 - 2
kalliope/core/Cortex.py

@@ -110,5 +110,7 @@ class Cortex(with_metaclass(Singleton, object)):
             for key, value in order_parameters.items():
                 # ask the cortex to save in memory the target "key" if it was in the order
                 if Utils.is_containing_bracket(value):
-                    value = jinja2.Template(value).render(Cortex.temp)
-                    Cortex.save(key, value)
+                    # if the key exist in the temp dict we can load it with jinja
+                    if value in Cortex.temp:
+                        value = jinja2.Template(value).render(Cortex.temp)
+                        Cortex.save(key, value)