From 8779d22642bfb41230b20b6e7e61266abb37fb87 Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Wed, 18 Sep 2024 09:26:13 +0200 Subject: [PATCH] Put the form attrs on the class, not the instance This way we no longer need override the form __init__. --- python/nav/web/seeddb/forms/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/nav/web/seeddb/forms/__init__.py b/python/nav/web/seeddb/forms/__init__.py index 4f3f4e64c7..6f67e1e897 100644 --- a/python/nav/web/seeddb/forms/__init__.py +++ b/python/nav/web/seeddb/forms/__init__.py @@ -192,10 +192,7 @@ class RoomFilterForm(forms.Form): Location.objects.order_by('id').all(), required=False, label_suffix='' ) location.widget.attrs.update({"class": "select"}) - - def __init__(self, *args, **kwargs): - super(RoomFilterForm, self).__init__(*args, **kwargs) - self.no_crispy = set_filter_form_attributes('Filter rooms') + no_crispy = set_filter_form_attributes('Filter rooms') class RoomForm(forms.ModelForm):