Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #885

git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@1375 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit fbae051559b5465ddd4a959dbd72d8178d05c577 1 parent c8719b7
@rjwittams rjwittams authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 django/core/template/loader.py
View
6 django/core/template/loader.py
@@ -21,7 +21,7 @@
# installed, because pkg_resources is necessary to read eggs.
from django.core.exceptions import ImproperlyConfigured
-from django.core.template import Origin, StringOrigin, Template, Context, Node, TemplateDoesNotExist, TemplateSyntaxError, resolve_variable_with_filters, register_tag
+from django.core.template import Origin, StringOrigin, Template, Context, Node, TemplateDoesNotExist, TemplateSyntaxError, resolve_variable_with_filters, resolve_variable, register_tag
from django.conf.settings import TEMPLATE_LOADERS, TEMPLATE_DEBUG
template_source_loaders = []
@@ -207,9 +207,11 @@ def render(self, context):
template_name = resolve_variable(self.template_name, context)
t = get_template(template_name)
return t.render(context)
- except Exception, e:
+ except TemplateSyntaxError, e:
if TEMPLATE_DEBUG:
raise
+ return ''
+ except:
return '' # Fail silently for invalid included templates.
def do_block(parser, token):
Please sign in to comment.
Something went wrong with that request. Please try again.