Skip to main content

UserChangeForm

This class provides a model form for updating user information and managing account permissions. It includes a read-only password field that displays security information instead of raw password data and optimizes permission queries using select_related. The form automatically adjusts help text based on whether the user has a usable password set.

Attributes

AttributeTypeDescription
password[ReadOnlyPasswordHashField](readonlypasswordhashfield.md?sid=django_contrib_auth_forms_readonlypasswordhashfield)Raw passwords are not stored, so there is no way to see the user’s password.

Constructor

Signature

def UserChangeForm(
*args: any,
**kwargs: any
)

Parameters

NameTypeDescription
*argsanyVariable length argument list.
**kwargsanyArbitrary keyword arguments.

Signature

def UserChangeForm(
*args: tuple,
**kwargs: dict
)

Parameters

NameTypeDescription
*argstuplePositional arguments passed to the parent ModelForm constructor
**kwargsdictKeyword arguments containing form data, initial values, and the model instance