#36909: Avoid using context.request directly in querystring template tag
-------------------------------------+-------------------------------------
Reporter: Jake Howard | Owner: Yogya
| Chugh
Type: Bug | Status: assigned
Component: Template system | Version: 5.1
Severity: Normal | Resolution:
Keywords: querystring | Triage Stage:
requestcontext | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jake Howard):
* stage: Accepted => Unreviewed
Comment:
`RequestContext` should by definition always have a request. The
difference is that now it always adds the request into its context, which
negates the need for the request context processor entirely. Context
processors are
[https://github.com/django/django/blob/fb3a11071aae27ef869d2b029289b9f59cc41128/django/template/context.py#L263
run by RequestContext], which means if the context processors run, there
**will** be a request in context.
I think the request context processor should be deprecated (with a
warning, removed in 7.0), and the
[https://github.com/django/django/commit/d522b51c401429c169d88742178a9b3777903d9e
check] implemented as part of #31575 can be removed. I can't think of a
case where you'd explicitly not want `request` in the context, so
deprecating it shouldn't be high impact. With that, the
`test_sidebar_aria_current_page_missing_without_request_context_processor`
test is no longer necessary.
Given the scope has changed a fair bit, this probably warrants an
additional triage before continuing. Natalia, does the new deprecation
sound sensible? The deprecation //could// be its own ticket, however the
test would still need to be removed.
--
Ticket URL: <https://code.djangoproject.com/ticket/36909#comment:19>
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 view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019c6d7ad403-6dba0c6c-e118-45be-846e-2ee55091d39b-000000%40eu-central-1.amazonses.com.