From 12b9ef38b3ff7f5b8b24a5f42e8923fdb6db44bb Mon Sep 17 00:00:00 2001 From: Mohammadreza Eskandari <33634829+mohammadrezaesk@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:34:35 +0300 Subject: Fixed #36121 -- Allowed customizing the admin site password change form. --- tests/admin_views/forms.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/admin_views/forms.py') diff --git a/tests/admin_views/forms.py b/tests/admin_views/forms.py index e9d9c0a8a5..3a3566c10f 100644 --- a/tests/admin_views/forms.py +++ b/tests/admin_views/forms.py @@ -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"] -- cgit v1.3