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

Get the password help text from Django #64

Merged
merged 1 commit into from
Nov 19, 2015
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
9 changes: 4 additions & 5 deletions authtools/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from django import forms, VERSION as DJANGO_VERSION
from django.contrib.auth.forms import (
ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget,
PasswordResetForm as OldPasswordResetForm
PasswordResetForm as OldPasswordResetForm,
UserChangeForm as DjangoUserChangeForm,
)
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import identify_hasher
Expand Down Expand Up @@ -151,10 +152,8 @@ class AdminUserChangeForm(UserChangeForm):
def __init__(self, *args, **kwargs):
super(AdminUserChangeForm, self).__init__(*args, **kwargs)
if not self.fields['password'].help_text:
self.fields['password'].help_text = _(
"Raw passwords are not stored, so there is no way to see this"
" user's password, but you can change the password using"
" <a href=\"../password/\">this form</a>.")
self.fields['password'].help_text = \
DjangoUserChangeForm.base_fields['password'].help_text


class FriendlyPasswordResetForm(OldPasswordResetForm):
Expand Down