Skip to content

Commit

Permalink
Uncrispify PrefixVlanForm in seedDB
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Oct 9, 2024
1 parent fb52d6a commit cdd955a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions python/nav/web/seeddb/page/prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"""
Expand Down
6 changes: 5 additions & 1 deletion python/nav/web/templates/seeddb/edit_prefix.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

0 comments on commit cdd955a

Please sign in to comment.