From ce8cedfdee96663d0a25d2c0f29d74546f24b925 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sat, 10 Sep 2011 08:18:25 +0530 Subject: [PATCH] argh, template render errors, catch --- itf/app/models.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/itf/app/models.py b/itf/app/models.py index 3ebfdb1..015e5f9 100644 --- a/itf/app/models.py +++ b/itf/app/models.py @@ -82,13 +82,12 @@ class ItfModel(models.Model): def insidepage_dict(self): if not exists(self.get_template_path()): - return { - 'html': "Template for this model not found." - } - try: - html = render_to_string(self.get_template_path(), self.info_dict()) - except: - html = "Template render error." + html = "Template not found." + else: + try: + html = render_to_string(self.get_template_path(), self.info_dict()) + except: + html = "Template render error." return { 'url': self.get_absolute_url(), 'title': self.get_title(),