Opened 4 years ago

Last modified 4 years ago

#31189 closed Cleanup/optimization

django.contrib.auth: Password field help text generates invalid html — at Version 1

Reported by: Marc Nieper-Wißkirchen Owned by: nobody
Component: contrib.auth Version: 3.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Marc Nieper-Wißkirchen)

The help text for the password field of, say, the UserCreationForm, is generated here: https://github.com/django/django/blob/master/django/contrib/auth/password_validation.py#L78 and is an html list. The form methods, as_table' and as_p', however, wrap the help text into a span tag. In the resulting rendered HTML, there will thus be a ul tag inside a span tag, which is invalid html.

To solve this problem, the span tag needs at least to be a div. But then there is the problem that `as_p' renders everything inside a paragraph, which also cannot take an html list, only phrasing content.

Change History (1)

comment:1 by Marc Nieper-Wißkirchen, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top