Skip to content
Snippets Groups Projects
Commit 2552e787 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Displaying errors associated with hidden field (normally never, but useful during development)

parent 34f28e9e
No related branches found
No related tags found
1 merge request!1Wizard form
......@@ -27,7 +27,11 @@ def bootstrap_core(object):
if isinstance(object, forms.BoundField):
field = object
if isinstance(field.field.widget, forms.HiddenInput):
return [field.as_widget(), ]
ret.append(field.as_widget())
if field.errors:
for e in field.errors:
ret.append("""<div class="alert alert-danger">%s: %s</div>""" % (field.name, e,))
return ret
attrs = field.field.widget.attrs
# get the class specified in the code
css_classes = set(attrs.get("class", "").split(" "))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment