﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21065	Internally choosing how to process a template is inconsistent	Keryn Knight <django@…>	IronJam	"[https://github.com/django/django/tree/ec47de77d6a7bc9327047d157fb5706751413f18/django/template/base.py#L1201 inclusion_tag] checks the following:
* Is it a Template instance?
* Or is it ''not'' a string, and ''is it iterable?'' '''is_iterable would allow genexps/dictionaries through'''
* Both the above failed? Should be a string.
[https://github.com/django/django/tree/ec47de77d6a7bc9327047d157fb5706751413f18/django/template/loader.py#L159 render_to_string] checks the following:
* is it a ''list or tuple''? '''doesn't allow genexps/dictionaries/etc'''
* No? It must be a string
* '''doesn't account for being passed a Template instance at all'''
[https://github.com/django/django/tree/ec47de77d6a7bc9327047d157fb5706751413f18/django/template/response.py#L53 SimpleTemplateResponse] checks the following:
* is it a ''list or a tuple'' ('''consistent with render_to_string''')
* No; is it a string?  ('''consistent with render_to_string''')
* No; ok, it must be a template instance ('''inconsistent with render_to_string, sort of consistent with inclusion_tag''')

I discovered this while trying to choose how to fix #20995, which would again be different; I don't really want to push a pull request for that one without knowing what the outcome of this is, though. It might be worth introducing a single function (`resolve_template` or something) which provides a consistent way to take an input and decide how to get from it to a Template instance."	Cleanup/optimization	assigned	Template system	dev	Normal			berker.peksag@… bcail	Accepted	0	0	0	0	0	0
