summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorCurtis Maloney <curtis@tinbrain.net>2013-08-28 22:17:20 +1000
committerAnssi Kääriäinen <akaariai@gmail.com>2013-08-29 10:22:24 +0300
commit5cdacbda034af928f5033c9afc7b50ee0b13f75c (patch)
tree5621b597d673fffbcca6c70fbdd3f132ec1b1f31 /django
parent169637649baa012a8a77b17465c5c0c1085336ea (diff)
Fixed #17356 -- Allowed {% include %} to render compiled templates
Reviewed by Loic Bistuer and Tim Graham.
Diffstat (limited to 'django')
-rw-r--r--django/template/loader_tags.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/template/loader_tags.py b/django/template/loader_tags.py
index d48f85eb35..224efe884b 100644
--- a/django/template/loader_tags.py
+++ b/django/template/loader_tags.py
@@ -159,8 +159,11 @@ class IncludeNode(BaseIncludeNode):
def render(self, context):
try:
- template_name = self.template_name.resolve(context)
- template = get_template(template_name)
+ template = self.template_name.resolve(context)
+ # Does this quack like a Template?
+ if not callable(getattr(template, 'render', None)):
+ # If not, we'll try get_template
+ template = get_template(template)
return self.render_template(template, context)
except:
if settings.TEMPLATE_DEBUG: