summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-04-12 03:31:03 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-04-12 03:31:03 +0000
commit853ee34191b6d49bf19743b4ed4feb779ff66f1a (patch)
tree13c91943b7d6bd0d76c2a7606038608d06d93f13
parentc862e43f7fb56b6cf1569c7a27c941eb16ab1c29 (diff)
Fixed #1531 -- Fixed eager exception catching that caused the template system to report a base template didn't exist when indeed it does exist but contains an {% include %} of a nonexisting template
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2681 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/template/loader_tags.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/core/template/loader_tags.py b/django/core/template/loader_tags.py
index 15beec9dff..238ece348c 100644
--- a/django/core/template/loader_tags.py
+++ b/django/core/template/loader_tags.py
@@ -50,9 +50,11 @@ class ExtendsNode(Node):
error_msg += " Got this from the %r variable." % self.parent_name_expr #TODO nice repr.
raise TemplateSyntaxError, error_msg
try:
- return get_template_from_string(*find_template_source(parent, self.template_dirs))
+ source, origin = find_template_source(parent, self.template_dirs)
except TemplateDoesNotExist:
raise TemplateSyntaxError, "Template %r cannot be extended, because it doesn't exist" % parent
+ else:
+ return get_template_from_string(source, origin)
def render(self, context):
compiled_parent = self.get_parent(context)