summaryrefslogtreecommitdiff
path: root/django/contrib/auth
diff options
context:
space:
mode:
authorSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-01-17 17:44:25 +0100
committernessita <124304+nessita@users.noreply.github.com>2025-04-17 12:00:20 -0300
commitd755a98b8438c10f3cff61303ceb1fe16d414e9b (patch)
tree7fe508bdc927f8abe04fd2457abbb471daac6203 /django/contrib/auth
parent8a0ad1ebe313a4f4fca6e9068c06ee400d15b8a4 (diff)
Fixed #35959 -- Displayed password reset button in admin only when user has sufficient permissions.
This change ensures that the "Reset password" button in the admin is shown only when the user has the necessary permission to perform a password change operation. It reuses the password hashing rendering logic in `display_for_field` to show the appropriate read-only widget for users with view-only access.
Diffstat (limited to 'django/contrib/auth')
-rw-r--r--django/contrib/auth/forms.py1
1 files changed, 0 insertions, 1 deletions
diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
index 7b0b3833b8..2214e134d0 100644
--- a/django/contrib/auth/forms.py
+++ b/django/contrib/auth/forms.py
@@ -34,7 +34,6 @@ def _unicode_ci_compare(s1, s2):
class ReadOnlyPasswordHashWidget(forms.Widget):
template_name = "auth/widgets/read_only_password_hash.html"
- read_only = True
def get_context(self, name, value, attrs):
context = super().get_context(name, value, attrs)