mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #16860 -- Fixed password help text when there aren't any validators.
This avoids creating an empty list which is invalid HTML 4.
This commit is contained in:
committed by
Tim Graham
parent
c14b6b52ff
commit
53ccffdb8c
@@ -84,7 +84,7 @@ def password_validators_help_text_html(password_validators=None):
|
||||
"""
|
||||
help_texts = password_validators_help_texts(password_validators)
|
||||
help_items = [format_html('<li>{}</li>', help_text) for help_text in help_texts]
|
||||
return '<ul>%s</ul>' % ''.join(help_items)
|
||||
return '<ul>%s</ul>' % ''.join(help_items) if help_items else ''
|
||||
|
||||
|
||||
class MinimumLengthValidator(object):
|
||||
|
||||
Reference in New Issue
Block a user