Opened 8 years ago

Closed 7 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


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 8 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 8 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by Sasha Gaevsky

Owner: changed from nobody to Sasha Gaevsky
Status: newassigned

comment:3 in reply to:  1 Changed 8 years ago by Sasha Gaevsky

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 Changed 8 years ago by Sasha Gaevsky

Has patch: set

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


comment:5 Changed 8 years ago by Tim Graham

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 Changed 8 years ago by Sasha Gaevsky

Asked about this in mailing list.

comment:7 Changed 8 years ago by Tim Graham

Patch needs improvement: unset

comment:8 Changed 8 years ago by Tim Graham

Needs tests: set

comment:9 Changed 7 years ago by Tim Graham <timograham@…>

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