mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #36121 -- Allowed customizing the admin site password change form.
This commit is contained in:
committed by
Sarah Boyce
parent
c6ace896a2
commit
12b9ef38b3
@@ -1,4 +1,4 @@
|
||||
from django.contrib.admin.forms import AdminAuthenticationForm
|
||||
from django.contrib.admin.forms import AdminAuthenticationForm, AdminPasswordChangeForm
|
||||
from django.contrib.admin.helpers import ActionForm
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
@@ -14,6 +14,12 @@ class CustomAdminAuthenticationForm(AdminAuthenticationForm):
|
||||
return username
|
||||
|
||||
|
||||
class CustomAdminPasswordChangeForm(AdminPasswordChangeForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["old_password"].label = "Custom old password label"
|
||||
|
||||
|
||||
class MediaActionForm(ActionForm):
|
||||
class Media:
|
||||
js = ["path/to/media.js"]
|
||||
|
||||
Reference in New Issue
Block a user