#27722: if a template context is an instance of get_template(), it will raise
"TypeError: context must be a dict rather than RequestContext"
---------------------------------+------------------------------------
Reporter: Sayid Munawar | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.11
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Comment (by Aymeric Augustin):
I didn't know this was possible. I'm not seeing obvious use cases -- why
would you pass a template instance rather than a template identifier and
let the template loader do its job? But indeed it's documented.
Anyway, `{% include compiled_template %}` path wraps a Context in another
Context, while `{% include 'template_to_compile.html' %}` doesn't. I don't
see why these two code paths handle context differently when
`compiled_template = get_template('template_to_compile.html')`. This is
likely a bug or a potential source of bugs, and the root cause of the
problem described here.
Of course, if no one wants to look into that, reverting
6a7495051304d75865add6ff96422018984e1663 is a reasonable way to avoid a
backwards incompatibility. It would still be worth creating another ticket
for resolving the inconsistency in context handling.
--
Ticket URL: <https://code.djangoproject.com/ticket/27722#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.8cc3eca61da335818f2b20b8d88aa0f2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.