Skip to content

Commit

Permalink
code lint, move __init__ to end of class
Browse files Browse the repository at this point in the history
  • Loading branch information
renatoalmeidaoliveira committed Jan 31, 2025
1 parent 576abc1 commit 621cda3
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions netbox/core/forms/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,6 @@ class JobFilterForm(SavedFiltersMixin, FilterForm):


class ObjectChangeFilterForm(SavedFiltersMixin, FilterForm):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

# Limit saved filters to those applicable to the form's model
object_type = ObjectType.objects.get_for_model(self.model)
self.fields['filter_id'].widget.add_query_params({
'object_type_id': object_type.pk,
})

model = ObjectChange
fieldsets = (
FieldSet('q', 'filter_id'),
Expand Down Expand Up @@ -170,6 +160,15 @@ def __init__(self, *args, **kwargs):
label=_('Object Type'),
)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

# Limit saved filters to those applicable to the form's model
object_type = ObjectType.objects.get_for_model(self.model)
self.fields['filter_id'].widget.add_query_params({
'object_type_id': object_type.pk,
})


class ConfigRevisionFilterForm(SavedFiltersMixin, FilterForm):
fieldsets = (
Expand Down

0 comments on commit 621cda3

Please sign in to comment.