Commit e24f8460 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

help_text have to be printed by the filter

parent 83665712
Pipeline #9353 passed with stage
in 9 minutes and 36 seconds
......@@ -29,9 +29,8 @@ def bootstrap(object):
# we propagate the "required" attribute
if field.field.required:
attrs['required'] = 'required'
# we propagate the "help_text" attribute to the widget if possible
if field.help_text and "help_text" not in attrs:
attrs["help_text "] = field.help_text
# we fetch the "help_text" attribute from wherever we can
help_text = getattr(field, "help_text", None) or attrs.get("help_text", None)
if isinstance(field.field.widget, widgets.CheckboxInput):
# if it is a checkbox, we the classes are not the same
......@@ -60,6 +59,8 @@ def bootstrap(object):
ret.append('<div class="%s">' % wrapping_classes)
ret.append("""<label class="%s">%s</label>""" % (label_classes, field.label))
if help_text:
ret.append("""<small class ="form-text text-muted">%s</small>""" % help_text)
if field.errors:
# render its errors
for e in field.errors:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment