1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #11989 -- Allow passing a Template instance to inclusion_tag. Thanks to Jeremy Dunck and tcoenen.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16374 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-06-11 16:22:45 +00:00
parent d27f909d2e
commit 0ebaf10258
4 changed files with 61 additions and 1 deletions

View File

@@ -987,7 +987,9 @@ class Library(object):
if not getattr(self, 'nodelist', False):
from django.template.loader import get_template, select_template
if not isinstance(file_name, basestring) and is_iterable(file_name):
if isinstance(file_name, Template):
t = file_name
elif not isinstance(file_name, basestring) and is_iterable(file_name):
t = select_template(file_name)
else:
t = get_template(file_name)