From 0ce977215fc50700e991237d6a6c32cb57a80ec1 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Thu, 10 Oct 2024 13:54:43 +0200 Subject: [PATCH] Remove setting attrs and directly show form content --- .../nav/web/seeddb/page/management_profile/forms.py | 4 ---- .../templates/seeddb/management-profile/edit.html | 12 ++---------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/python/nav/web/seeddb/page/management_profile/forms.py b/python/nav/web/seeddb/page/management_profile/forms.py index e691dd8c49..8de92c26df 100644 --- a/python/nav/web/seeddb/page/management_profile/forms.py +++ b/python/nav/web/seeddb/page/management_profile/forms.py @@ -85,8 +85,6 @@ def __init__(self, *args, **kwargs): if field in cfg: self.fields[field].initial = cfg.get(field) - self.attrs = set_flat_form_attributes() - def _post_clean(self): super(ProtocolSpecificMixIn, self)._post_clean() cfg = self.instance.configuration @@ -295,8 +293,6 @@ class Meta(object): def __init__(self, *args, **kwargs): super(ManagementProfileForm, self).__init__(*args, **kwargs) - self.attrs = set_flat_form_attributes() - def get_protocol_form_class(self): """Returns the protocol-specific form class that corresponds with the selected management protocol of this profile. diff --git a/python/nav/web/templates/seeddb/management-profile/edit.html b/python/nav/web/templates/seeddb/management-profile/edit.html index 411ccd0bfa..b30c914720 100644 --- a/python/nav/web/templates/seeddb/management-profile/edit.html +++ b/python/nav/web/templates/seeddb/management-profile/edit.html @@ -26,11 +26,7 @@

Add new management profile

Basic profile data - {% if form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' %}
@@ -41,11 +37,7 @@

Add new management profile

{% if form.NOTABENE %}
{{ form.NOTABENE }}
{% endif %} - {% if form.attrs %} - {% include 'custom_crispy_templates/_form_content.html' %} - {% else %} - {{ form }} - {% endif %} + {% include 'custom_crispy_templates/_form_content.html' %} {% endfor %}