[Django] #24126: Consider deprecating the current_app argument of auth views

14 views
Skip to first unread message

Django

unread,
Jan 11, 2015, 1:37:45 PM1/11/15
to django-...@googlegroups.com
#24126: Consider deprecating the current_app argument of auth views
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: | Version: master
contrib.auth | Keywords: multiple-template-
Severity: Normal | engines
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
All views defined in `django.contrib.auth.views` have the following
structure:

{{{
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.

Django

unread,
Jan 12, 2015, 2:12:30 PM1/12/15
to django-...@googlegroups.com
#24126: Consider deprecating the current_app argument of auth views
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: multiple-template- | Triage Stage: Accepted
engines |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* 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>

Django

unread,
Feb 6, 2015, 12:57:45 PM2/6/15
to django-...@googlegroups.com
#24126: Consider deprecating the current_app argument of auth views
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: current_app | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by aaugustin):

* keywords: multiple-template-engines => current_app


--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:2>

Django

unread,
Jun 5, 2015, 10:19:11 AM6/5/15
to django-...@googlegroups.com
#24126: Consider deprecating the current_app argument of auth views
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: lukawoj
Type: Cleanup/optimization | Status: assigned

Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: current_app | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by lukawoj):

* status: new => assigned
* owner: nobody => lukawoj


--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:3>

Django

unread,
Jun 5, 2015, 11:51:23 AM6/5/15
to django-...@googlegroups.com
#24126: Consider deprecating the current_app argument of auth views
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: lukawoj
Type: Cleanup/optimization | Status: assigned
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: current_app | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by lukawoj):

* 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>

Django

unread,
Jun 6, 2015, 10:09:11 AM6/6/15
to django-...@googlegroups.com
#24126: Consider deprecating the current_app argument of auth views
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: lukawoj
Type: Cleanup/optimization | Status: assigned
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: current_app | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24126#comment:5>

Django

unread,
Jun 23, 2015, 10:34:20 AM6/23/15
to django-...@googlegroups.com
#24126: Consider deprecating the current_app argument of auth views
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: lukawoj
Type: Cleanup/optimization | Status: assigned
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: current_app | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

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>

Django

unread,
Jul 21, 2015, 8:44:44 AM7/21/15
to django-...@googlegroups.com
#24126: Consider deprecating the current_app argument of auth views
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: lukawoj
Type: Cleanup/optimization | Status: closed
Component: contrib.auth | Version: master
Severity: Normal | Resolution: fixed

Keywords: current_app | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* 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>

Django

unread,
Jan 17, 2017, 10:09:51 PM1/17/17
to django-...@googlegroups.com
#24126: Consider deprecating the current_app argument of auth views
--------------------------------------+------------------------------------
Reporter: Aymeric Augustin | Owner: lukawoj

Type: Cleanup/optimization | Status: closed
Component: contrib.auth | Version: master
Severity: Normal | Resolution: fixed
Keywords: current_app | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages