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
......@@ -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(), ]
if field.errors:
for e in field.errors:
ret.append("""<div class="alert alert-danger">%s: %s</div>""" % (, e,))
return ret
attrs = field.field.widget.attrs
# get the class specified in the code
css_classes = set(attrs.get("class", "").split(" "))
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