mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Fixed #34677 -- Made admin password reset templates more consistent.
This commit is contained in:
parent
1d0dfc0b92
commit
0016a42995
1
AUTHORS
1
AUTHORS
@ -809,6 +809,7 @@ answer newbie questions, and generally made Django that much better:
|
||||
pradeep.gowda@gmail.com
|
||||
Preston Holmes <preston@ptone.com>
|
||||
Preston Timmons <prestontimmons@gmail.com>
|
||||
Priyank Panchal <priyankpanchal872000@gmail.com>
|
||||
Priyansh Saxena <askpriyansh@gmail.com>
|
||||
Przemysław Buczkowski <przemub@przemub.pl>
|
||||
Przemysław Suliga <http://suligap.net>
|
||||
|
@ -16,20 +16,26 @@
|
||||
<p>{% translate "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
|
||||
|
||||
<form method="post">{% csrf_token %}
|
||||
<fieldset class="module aligned">
|
||||
<fieldset class="module aligned">
|
||||
<input class="hidden" autocomplete="username" value="{{ form.user.get_username }}">
|
||||
<div class="form-row field-password1">
|
||||
{{ form.new_password1.errors }}
|
||||
{{ form.new_password1.errors }}
|
||||
<div class="flex-container">
|
||||
<label for="id_new_password1">{% translate 'New password:' %}</label>
|
||||
{{ form.new_password1 }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row field-password2">
|
||||
{{ form.new_password2.errors }}
|
||||
{{ form.new_password2.errors }}
|
||||
<div class="flex-container">
|
||||
<label for="id_new_password2">{% translate 'Confirm password:' %}</label>
|
||||
{{ form.new_password2 }}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="submit-row">
|
||||
<input type="submit" value="{% translate 'Change my password' %}">
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% else %}
|
||||
|
@ -14,14 +14,18 @@
|
||||
<p>{% translate 'Forgotten your password? Enter your email address below, and we’ll email instructions for setting a new one.' %}</p>
|
||||
|
||||
<form method="post">{% csrf_token %}
|
||||
<fieldset class="module aligned">
|
||||
<fieldset class="module aligned">
|
||||
<div class="form-row field-email">
|
||||
{{ form.email.errors }}
|
||||
{{ form.email.errors }}
|
||||
<div class="flex-container">
|
||||
<label for="id_email">{% translate 'Email address:' %}</label>
|
||||
{{ form.email }}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="submit-row">
|
||||
<input type="submit" value="{% translate 'Reset my password' %}">
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -3197,26 +3197,35 @@ Adding a password reset feature
|
||||
You can add a password reset feature to the admin site by adding a few lines to
|
||||
your URLconf. Specifically, add these four patterns::
|
||||
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth import views as auth_views
|
||||
|
||||
path(
|
||||
"admin/password_reset/",
|
||||
auth_views.PasswordResetView.as_view(),
|
||||
auth_views.PasswordResetView.as_view(
|
||||
extra_context={"site_header": admin.site.site_header}
|
||||
),
|
||||
name="admin_password_reset",
|
||||
),
|
||||
path(
|
||||
"admin/password_reset/done/",
|
||||
auth_views.PasswordResetDoneView.as_view(),
|
||||
auth_views.PasswordResetDoneView.as_view(
|
||||
extra_context={"site_header": admin.site.site_header}
|
||||
),
|
||||
name="password_reset_done",
|
||||
),
|
||||
path(
|
||||
"reset/<uidb64>/<token>/",
|
||||
auth_views.PasswordResetConfirmView.as_view(),
|
||||
auth_views.PasswordResetConfirmView.as_view(
|
||||
extra_context={"site_header": admin.site.site_header}
|
||||
),
|
||||
name="password_reset_confirm",
|
||||
),
|
||||
path(
|
||||
"reset/done/",
|
||||
auth_views.PasswordResetCompleteView.as_view(),
|
||||
auth_views.PasswordResetCompleteView.as_view(
|
||||
extra_context={"site_header": admin.site.site_header}
|
||||
),
|
||||
name="password_reset_complete",
|
||||
),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user