Skip to content

Commit

Permalink
fix: readonly password hash label (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed May 30, 2024
1 parent ee4b333 commit b424b86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/unfold/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from django.contrib.auth.forms import (
AdminPasswordChangeForm as BaseAdminPasswordChangeForm,
)
from django.contrib.auth.forms import ReadOnlyPasswordHashWidget
from django.contrib.auth.forms import UserChangeForm as BaseUserChangeForm
from django.contrib.auth.forms import UserCreationForm as BaseUserCreationForm
from django.http import HttpRequest
Expand All @@ -19,6 +20,10 @@
from .widgets import BASE_INPUT_CLASSES, INPUT_CLASSES, SELECT_CLASSES


class UnfoldReadOnlyPasswordHashWidget(ReadOnlyPasswordHashWidget):
pass


class ActionForm(forms.Form):
action = forms.ChoiceField(
label="",
Expand Down Expand Up @@ -72,6 +77,7 @@ def __init__(
**kwargs,
) -> None:
super().__init__(request, *args, **kwargs)
self.fields["password"].widget = UnfoldReadOnlyPasswordHashWidget()

self.fields["password"].help_text = _(
"Raw passwords are not stored, so there is no way to see this "
Expand Down

0 comments on commit b424b86

Please sign in to comment.