diff --git a/python/nav/web/seeddb/page/prefix.py b/python/nav/web/seeddb/page/prefix.py index a3c19834e5..5b4926feb4 100644 --- a/python/nav/web/seeddb/page/prefix.py +++ b/python/nav/web/seeddb/page/prefix.py @@ -31,6 +31,7 @@ from nav.bulkparse import PrefixBulkParser from nav.bulkimport import PrefixImporter +from nav.web.crispyforms import set_flat_form_attributes from nav.web.seeddb import SeeddbInfo from nav.web.seeddb.constants import SEEDDB_EDITABLE_MODELS from nav.web.seeddb.page import view_switcher, not_implemented @@ -83,6 +84,8 @@ class Meta(object): 'net_type', ) + attrs = set_flat_form_attributes() + def get_prefix_view(request): """Select appropriate view based on request POST data""" diff --git a/python/nav/web/templates/seeddb/edit_prefix.html b/python/nav/web/templates/seeddb/edit_prefix.html index 71b5882232..34e22cb12b 100644 --- a/python/nav/web/templates/seeddb/edit_prefix.html +++ b/python/nav/web/templates/seeddb/edit_prefix.html @@ -2,5 +2,9 @@ {% load crispy_forms_tags %} {% block crispyfields %} {{ block.super }} -{{ vlan_form|crispy }} +{% if vlan_form.attrs %} + {% include 'custom_crispy_templates/_form_content.html' with form=vlan_form %} +{% else %} + {{ vlan_form }} +{% endif %} {% endblock %}