1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #24126 -- Deprecated current_app parameter to auth views.

This commit is contained in:
lukasz.wojcik
2015-06-05 16:42:05 +01:00
committed by Tim Graham
parent 5fd83db255
commit 927b30a6ab
5 changed files with 112 additions and 39 deletions

View File

@@ -84,6 +84,8 @@ details on these changes.
* ``django.template.loaders.eggs.Loader`` will be removed.
* The ``current_app`` parameter to the ``contrib.auth`` views will be removed.
.. _deprecation-removed-in-1.10:
1.10

View File

@@ -981,6 +981,24 @@ impossible to reverse the patterns if there was an application namespace
with the same name. Includes that specify an instance namespace require that
the included URLconf sets an application namespace.
``current_app`` parameter to ``contrib.auth`` views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All views 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. For
consistency, these views will require the caller to set ``current_app`` on the
``request`` instead of passing it in a separate argument.
Miscellaneous
~~~~~~~~~~~~~

View File

@@ -933,6 +933,11 @@ implementation details see :ref:`using-the-views`.
* ``extra_context``: A dictionary of context data that will be added to the
default context data passed to the template.
.. deprecated:: 1.9
The ``current_app`` parameter is deprecated and will be removed in
Django 2.0. Callers should set ``request.current_app`` instead.
Here's what ``django.contrib.auth.views.login`` does:
* If called via ``GET``, it displays a login form that POSTs to the
@@ -1059,6 +1064,11 @@ implementation details see :ref:`using-the-views`.
* ``extra_context``: A dictionary of context data that will be added to the
default context data passed to the template.
.. deprecated:: 1.9
The ``current_app`` parameter is deprecated and will be removed in
Django 2.0. Callers should set ``request.current_app`` instead.
**Template context:**
* ``title``: The string "Logged out", localized.
@@ -1100,6 +1110,11 @@ implementation details see :ref:`using-the-views`.
* ``extra_context``: A dictionary of context data that will be added to the
default context data passed to the template.
.. deprecated:: 1.9
The ``current_app`` parameter is deprecated and will be removed in
Django 2.0. Callers should set ``request.current_app`` instead.
.. function:: password_change(request[, template_name, post_change_redirect, password_change_form, current_app, extra_context])
Allows a user to change their password.
@@ -1127,6 +1142,11 @@ implementation details see :ref:`using-the-views`.
* ``extra_context``: A dictionary of context data that will be added to the
default context data passed to the template.
.. deprecated:: 1.9
The ``current_app`` parameter is deprecated and will be removed in
Django 2.0. Callers should set ``request.current_app`` instead.
**Template context:**
* ``form``: The password change form (see ``password_change_form`` above).
@@ -1150,6 +1170,11 @@ implementation details see :ref:`using-the-views`.
* ``extra_context``: A dictionary of context data that will be added to the
default context data passed to the template.
.. deprecated:: 1.9
The ``current_app`` parameter is deprecated and will be removed in
Django 2.0. Callers should set ``request.current_app`` instead.
.. function:: password_reset(request[, is_admin_site, template_name, email_template_name, password_reset_form, token_generator, post_reset_redirect, from_email, current_app, extra_context, html_email_template_name])
Allows a user to reset their password by generating a one-time use link
@@ -1216,6 +1241,11 @@ implementation details see :ref:`using-the-views`.
The ``is_admin_site`` argument is deprecated and will be removed in
Django 1.10.
.. deprecated:: 1.9
The ``current_app`` parameter is deprecated and will be removed in
Django 2.0. Callers should set ``request.current_app`` instead.
**Template context:**
* ``form``: The form (see ``password_reset_form`` above) for resetting
@@ -1281,6 +1311,11 @@ implementation details see :ref:`using-the-views`.
* ``extra_context``: A dictionary of context data that will be added to the
default context data passed to the template.
.. deprecated:: 1.9
The ``current_app`` parameter is deprecated and will be removed in
Django 2.0. Callers should set ``request.current_app`` instead.
.. function:: password_reset_confirm(request[, uidb64, token, template_name, token_generator, set_password_form, post_reset_redirect, current_app, extra_context])
Presents a form for entering a new password.
@@ -1322,6 +1357,11 @@ implementation details see :ref:`using-the-views`.
* ``validlink``: Boolean, True if the link (combination of ``uidb64`` and
``token``) is valid or unused yet.
.. deprecated:: 1.9
The ``current_app`` parameter is deprecated and will be removed in
Django 2.0. Callers should set ``request.current_app`` instead.
.. function:: password_reset_complete(request[,template_name, current_app, extra_context])
Presents a view which informs the user that the password has been
@@ -1341,6 +1381,11 @@ implementation details see :ref:`using-the-views`.
* ``extra_context``: A dictionary of context data that will be added to the
default context data passed to the template.
.. deprecated:: 1.9
The ``current_app`` parameter is deprecated and will be removed in
Django 2.0. Callers should set ``request.current_app`` instead.
Helper functions
----------------