Opened 9 years ago

Closed 8 years ago

#26097 closed Bug (fixed)

UserCreationForm isn't using password_validators_help_text_html

Reported by: Adam Owned by: Sasha Gaevsky
Component: contrib.auth Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Unlike SetPasswordForm and AdminPasswordChangeForm, UserCreationForm is not using password_validators_help_text_html. I think this was probably accidentally left out of #25052. This means that the "Add user" form at /admin/auth/user/add/ provides no indication of what the password requirements are unless you provide a password that does not pass validation. Even then, it doesn't list what all of the password requirements are.

I tried adding help_text=password_validation.password_validators_help_text_html() to the UserCreationForm form's password1 field, but the CSS didn't work well with this (see the attached screen shot), so now I'm submitting this ticket.

Attachments (1)

add-user-password-help-text-misaligned.png (49.0 KB ) - added by Adam 9 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Sasha Gaevsky, 9 years ago

Owner: changed from nobody to Sasha Gaevsky
Status: newassigned

in reply to:  1 comment:3 by Sasha Gaevsky, 9 years ago

Replying to timgraham:

Could you please submit empty "Add user" and "Password change" forms in the admin?
There might be also another styling issue.

comment:4 by Sasha Gaevsky, 9 years ago

Has patch: set

Found incorrect indent for lists in the wide fieldsets - fixed it too.

PR

comment:5 by Tim Graham, 9 years ago

Patch needs improvement: set

I'm not sure about the proposal on the pull request to change <p> tags to <span> in order to allow help_text to contain <ul>. This might be a bit disruptive for anyone extending the admin with custom markup or CSS. I don't have a good solution in mind but suggested to write to the DevelopersMailingList to get feedback on this before we proceed with it. Marking "Patch needs improvement" as an indication of that need.

comment:6 by Sasha Gaevsky, 9 years ago

Asked about this in mailing list.

comment:7 by Tim Graham, 9 years ago

Patch needs improvement: unset

comment:8 by Tim Graham, 9 years ago

Needs tests: set

comment:9 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 536db42:

Fixed #26097 -- Added password_validators_help_text_html to UserCreationForm.

Note: See TracTickets for help on using tickets.
Back to Top