Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #18460 -- Fixed change detection of ReadOnlyPasswordHashField

Thanks jose.sanchez et ezeep.com for the report and Vladimir Ulupov
for the initial patch.
  • Loading branch information...
commit 1686e0d184aaf704e5131a8651a070c4a0e58b03 1 parent ebb504d
@claudep claudep authored
View
3  django/contrib/auth/forms.py
@@ -57,6 +57,9 @@ def bound_data(self, data, initial):
# render an input field.
return initial
+ def _has_changed(self, initial, data):
+ return False
+
class UserCreationForm(forms.ModelForm):
"""
View
8 django/contrib/auth/tests/forms.py
@@ -4,7 +4,7 @@
from django.contrib.auth.models import User
from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm,
PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm,
- ReadOnlyPasswordHashWidget)
+ ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget)
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.core import mail
from django.forms.fields import Field, EmailField, CharField
@@ -384,7 +384,7 @@ def test_unusable_password(self):
[_("The user account associated with this email address cannot reset the password.")])
-class ReadOnlyPasswordHashWidgetTest(TestCase):
+class ReadOnlyPasswordHashTest(TestCase):
def test_bug_19349_render_with_none_value(self):
# Rendering the widget with value set to None
@@ -392,3 +392,7 @@ def test_bug_19349_render_with_none_value(self):
widget = ReadOnlyPasswordHashWidget()
html = widget.render(name='password', value=None, attrs={})
self.assertIn(_("No password set."), html)
+
+ def test_readonly_field_has_changed(self):
+ field = ReadOnlyPasswordHashField()
+ self.assertFalse(field._has_changed('aaa', 'bbb'))

0 comments on commit 1686e0d

Please sign in to comment.
Something went wrong with that request. Please try again.