Skip to content

Commit

Permalink
Remove setting attrs and directly show form content
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Oct 10, 2024
1 parent 8e30f5b commit 841378f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
4 changes: 0 additions & 4 deletions python/nav/web/seeddb/page/management_profile/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
14 changes: 3 additions & 11 deletions python/nav/web/templates/seeddb/management-profile/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ <h4>Add new management profile</h4>
<div class="columns large-4">
<fieldset>
<legend>Basic profile data</legend>
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
{% include 'custom_crispy_templates/_form_content.html' %}
</fieldset>
</div>

Expand All @@ -41,12 +37,8 @@ <h4>Add new management profile</h4>
{% if form.NOTABENE %}
<div class="alert-box warning with-icon">{{ form.NOTABENE }}</div>
{% endif %}
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
</fieldset>
{% include 'custom_crispy_templates/_form_content.html' %}
</fieldset>
{% endfor %}
</div>
</div>
Expand Down

0 comments on commit 841378f

Please sign in to comment.