Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: readonly password hash label #423

Merged
merged 1 commit into from
May 30, 2024
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