Opened 10 years ago
Closed 9 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)
Change History (10)
by , 10 years ago
| Attachment: | add-user-password-help-text-misaligned.png added |
|---|
follow-up: 3 comment:1 by , 10 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 10 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 10 years ago
comment:4 by , 10 years ago
| Has patch: | set |
|---|
Found incorrect indent for lists in the wide fieldsets - fixed it too.
comment:5 by , 10 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:7 by , 10 years ago
| Patch needs improvement: | unset |
|---|
comment:8 by , 10 years ago
| Needs tests: | set |
|---|
Replying to timgraham:
Could you please submit empty "Add user" and "Password change" forms in the admin?
There might be also another styling issue.