From 59a82763293b9a8f634937f7c3a27c5d626c493a Mon Sep 17 00:00:00 2001 From: Johanna England Date: Wed, 9 Oct 2024 14:29:31 +0200 Subject: [PATCH] Use helper function to set management profile filter layout --- .../seeddb/page/management_profile/forms.py | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/python/nav/web/seeddb/page/management_profile/forms.py b/python/nav/web/seeddb/page/management_profile/forms.py index 8de92c26df..d61d57fe2a 100644 --- a/python/nav/web/seeddb/page/management_profile/forms.py +++ b/python/nav/web/seeddb/page/management_profile/forms.py @@ -23,6 +23,7 @@ SubmitField, set_flat_form_attributes, ) +from nav.web.seeddb.forms import get_single_layout PROTOCOL_CHOICES = dict(ManagementProfile.PROTOCOL_CHOICES) @@ -37,33 +38,8 @@ class ManagementProfileFilterForm(forms.Form): def __init__(self, *args, **kwargs): super(ManagementProfileFilterForm, self).__init__(*args, **kwargs) - self.attrs = set_flat_form_attributes( - form_class="custom", - form_method="get", - form_fields=[ - FlatFieldset( - legend="Filter connection profiles", - fields=[ - FormRow( - fields=[ - FormColumn( - fields=[self["protocol"]], css_classes="medium-8" - ), - FormColumn( - fields=[ - SubmitField( - value="Filter", - css_classes="postfix", - has_empty_label=True, - ) - ], - css_classes="medium-4", - ), - ] - ) - ], - ) - ], + self.attrs = get_single_layout( + heading="Filter connection profiles", row=self["protocol"] )