1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

handle server-side form errors

This commit is contained in:
checktheroads
2021-03-14 01:06:51 -07:00
parent d0cb7d843d
commit 59d8c0b321
2 changed files with 36 additions and 0 deletions

View File

@@ -54,3 +54,13 @@ def widget_type(field):
return field.field.widget.__class__.__name__.lower()
else:
return None
@register.inclusion_tag('utilities/render_errors.html')
def render_errors(form):
"""
Render form errors, if they exist.
"""
return {
"form": form
}