#19161: Line missing on Dev documentation -------------------------------+-------------------- Reporter: DavidW | Owner: nobody Type: Bug | Status: new Component: Documentation | Version: master Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 1 Easy pickings: 1 | UI/UX: 0 -------------------------------+-------------------- 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. -- Ticket URL: <https://code.djangoproject.com/ticket/19161> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.