﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19161	Missing clean_password in custom user documentation	DavidW	nobody	"https://docs.djangoproject.com/en/dev/topics/auth/#auth-custom-user

{{{
class UserChangeForm(forms.ModelForm):
    """"""A form for updateing users. Includes all the fields on
    the user, but replaces the password field with admin's
    pasword hash display field.
    """"""
    password = ReadOnlyPasswordHashField()

    class Meta:
        model = MyUser
}}}

Needs the following added:

{{{
    def clean_password(self):
        # Regardless of what the user provides, return the initial value.
        # This is done here, rather than on the field, because the
        # field does not have access to the initial value
        return self.initial[""password""]
}}}

Or you get a not-null constraint violation on form submit."	Bug	closed	Documentation	dev	Release blocker	fixed			Accepted	0	0	0	0	1	0
