#35484: This commit enhances the flexibility of the Django admin interface by
supporting custom user models more effectively.
-------------------------------------+-------------------------------------
Reporter: mehul963 | Owner: nobody
Type: New | Status: new
feature |
Component: | Version: 5.0
contrib.auth | Keywords: Admin panel,
Severity: Normal | Password Change Form, Custom User
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
**Issue:
**In Django, when we create a custom user model and register it in
admin.py, the change password form is not included by default. To add this
functionality, we need to make several adjustments. Additionally, we
cannot simply inherit the UserAdmin class from django.contrib.auth.admin
because if we remove the username field, we must override fieldsets,
list_display, search_fields, and ordering.
**Contribution:
**I have made a pull request that addresses this issue by:
Adding the USERNAME_FIELD to the UserAdmin class for automatic
registration and form compatibility with custom user models.
Ensuring that custom user models (based on AbstractUser) do not require
manual registration or model admin creation to include a change password
form.
Updating the UserAdmin class to handle custom user models without
requiring extensive overrides for common configurations.I have made a pull
request that adds the **USERNAME_FIELD** to **UserAdmin** for automatic
registration and form compatibility with custom user models. This update
ensures that custom user models (based on **AbstractUser**) do not require
manual registration or model admin creation to include a change password
form.
In django if we made custom user model and register user model in
admin.py. then we don't have change password form.
and to add this fucntionality we have to some changes as well we can not
inherit the UserAdmin class becouse if we remove the username field then
we have to overide fieldsets, list_display
==
--
Ticket URL: <https://code.djangoproject.com/ticket/35484>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018fbabeac6b-902e00d3-0d47-4576-a451-ee4c1d16f88d-000000%40eu-central-1.amazonses.com.