{{{
def view(request, ..., current_app=None, ...):
...
if current_app is not None:
request.current_app = current_app
return TemplateResponse(request, template_name, context)
}}}
As of Django 1.8 `current_app` is set on the `request` object. (This is
debated but no other concrete proposal has been made at this time.)
For consistency the auth views should require the caller to set it on the
`request` instead of passing it in a separate argument.
That would also avoid the risk of conflicts between a `current_app` set on
the `request` and another `current_app` passed in argument. Currently the
latter overrides the former.
--
Ticket URL: <https://code.djangoproject.com/ticket/24126>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
Comment:
I guess the use case of making it a view parameter is that maybe you want
to be able to simply use these views in a URLconf and specify the
`current_app` that way? Further investigation is likely required.
--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:1>
* keywords: multiple-template-engines => current_app
--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:2>
* status: new => assigned
* owner: nobody => lukawoj
--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:3>
* has_patch: 0 => 1
Comment:
Submitted pull request https://github.com/django/django/pull/4813
--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:4>
* needs_docs: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:5>
Comment (by timgraham):
It looks like the use case for adding `current_app` was for the admin:
cc64fb5c4b4315a4ad66e21458e27ece57266847.
If we automatically set the `current_app` as suggested in #24127, that
would allow us to proceed with this deprecation without having to add
`request.current_app = request.resolver_match.namespace` in all the admin
callers in `contrib/admin/sites.py`.
--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"927b30a6ab33ea33e5e3b1e7408ac1d5d267ff6a" 927b30a]:
{{{
#!CommitTicketReference repository=""
revision="927b30a6ab33ea33e5e3b1e7408ac1d5d267ff6a"
Fixed #24126 -- Deprecated current_app parameter to auth views.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"9f9a3d643ec52c5cfb08c1546d6855fb60e702a9" 9f9a3d64]:
{{{
#!CommitTicketReference repository=""
revision="9f9a3d643ec52c5cfb08c1546d6855fb60e702a9"
Refs #24126 -- Removed auth views' current_app parameter per deprecation
timeline.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:8>