Permalink
Browse files

Catch if a template is None.

  • Loading branch information...
ralphbean committed Aug 27, 2013
1 parent c31f527 commit a159b6cf1bf28f29063dcd00bd7db9af4d082985
Showing with 4 additions and 1 deletion.
  1. +1 −1 tw2/core/templating.py
  2. +3 −0 tw2/core/widgets.py
@@ -42,7 +42,7 @@ def get_engine_name(template_name, mw=None):
if template_name in engine_name_cache:
return engine_name_cache[template_name]
if ':' in template_name:
if template_name and ':' in template_name:
engine_name = template_name.split(':', 1)[0]
engine_name_cache[template_name] = engine_name
return engine_name
@@ -483,6 +483,9 @@ def generate_output(self, displays_on):
if hasattr(self, p):
kwargs[p] = getattr(self, p)
if self.template is None:
raise ValueError("A template must be provided.")
return templating.render(
self.template,
displays_on,

0 comments on commit a159b6c

Please sign in to comment.