Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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