summaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastermain/settings.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-06-22 14:54:08 +0100
committerAlexandru DAMIAN <alexandru.damian@intel.com>2015-06-25 11:08:25 +0100
commit3928dc93188880386588fe3f440cd0aaa83d22de (patch)
treebb9f4703f8c06f65cb7f0949bbbed4b585f1ab78 /lib/toaster/toastermain/settings.py
parent7ee0f1da0a8fcac37419ffdddbe35a9268a1ded4 (diff)
downloadbitbake-contrib-3928dc93188880386588fe3f440cd0aaa83d22de.tar.gz
toastergui: enable strict variable checking
In order to make sure we don't use undefined variables in the templates, we enforce strict variable checking in the templating engine. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Diffstat (limited to 'lib/toaster/toastermain/settings.py')
-rw-r--r--lib/toaster/toastermain/settings.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/toaster/toastermain/settings.py b/lib/toaster/toastermain/settings.py
index 3c7cb3bc4..141ad0887 100644
--- a/lib/toaster/toastermain/settings.py
+++ b/lib/toaster/toastermain/settings.py
@@ -386,3 +386,10 @@ connection_created.connect(activate_synchronous_off)
#
+class InvalidString(str):
+ def __mod__(self, other):
+ from django.template.base import TemplateSyntaxError
+ raise TemplateSyntaxError(
+ "Undefined variable or unknown value for: \"%s\"" % other)
+
+TEMPLATE_STRING_IF_INVALID = InvalidString("%s")