Fixed #4548 -- Added username hint to admin's change_password form.
This commit is contained in:
parent
686a593aaa
commit
5d8375fe66
|
@ -20,6 +20,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% block content %}<div id="content-main">
|
{% block content %}<div id="content-main">
|
||||||
<form action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}
|
<form action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}
|
||||||
|
<input type="text" name="username" value="{{ original.get_username }}" style="display: none" />
|
||||||
<div>
|
<div>
|
||||||
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
|
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
|
||||||
{% if form.errors %}
|
{% if form.errors %}
|
||||||
|
|
|
@ -958,15 +958,18 @@ class AdminCustomTemplateTests(AdminViewBasicTestCase):
|
||||||
response = self.client.get(reverse('admin:admin_views_section_add'))
|
response = self.client.get(reverse('admin:admin_views_section_add'))
|
||||||
self.assertContains(response, 'bodyclass_consistency_check ')
|
self.assertContains(response, 'bodyclass_consistency_check ')
|
||||||
|
|
||||||
def test_extended_bodyclass_template_change_password(self):
|
def test_change_password_template(self):
|
||||||
"""
|
|
||||||
Ensure that the auth/user/change_password.html template uses block
|
|
||||||
super in the bodyclass block.
|
|
||||||
"""
|
|
||||||
user = User.objects.get(username='super')
|
user = User.objects.get(username='super')
|
||||||
response = self.client.get(reverse('admin:auth_user_password_change', args=(user.id,)))
|
response = self.client.get(reverse('admin:auth_user_password_change', args=(user.id,)))
|
||||||
|
# The auth/user/change_password.html template uses super in the
|
||||||
|
# bodyclass block.
|
||||||
self.assertContains(response, 'bodyclass_consistency_check ')
|
self.assertContains(response, 'bodyclass_consistency_check ')
|
||||||
|
|
||||||
|
# When a site has multiple passwords in the browser's password manager,
|
||||||
|
# a browser pop up asks which user the new password is for. To prevent
|
||||||
|
# this, the username is added to the change password form.
|
||||||
|
self.assertContains(response, '<input type="text" name="username" value="super" style="display: none" />')
|
||||||
|
|
||||||
def test_extended_bodyclass_template_index(self):
|
def test_extended_bodyclass_template_index(self):
|
||||||
"""
|
"""
|
||||||
Ensure that the admin/index.html template uses block.super in the
|
Ensure that the admin/index.html template uses block.super in the
|
||||||
|
|
Loading…
Reference in New Issue