Skip to content

Commit

Permalink
remove filter_address method from IPRangeFilterSet
Browse files Browse the repository at this point in the history
  • Loading branch information
michalis1 committed Jan 15, 2025
1 parent c4f8c0c commit 0c7d497
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions nautobot_firewall_models/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import django_filters
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from nautobot.apps.filters import (
MultiValueCharFilter,
NaturalKeyOrPKMultipleChoiceFilter,
Expand Down Expand Up @@ -30,11 +29,9 @@ class IPRangeFilterSet(BaseFilterSet, NautobotFilterSet): # pylint: disable=too
"""Filter for IPRange."""

start_address = MultiValueCharFilter(
method="filter_address",
label="Address",
)
end_address = MultiValueCharFilter(
method="filter_address",
label="Address",
)

Expand All @@ -45,13 +42,6 @@ class Meta:

fields = [i.name for i in model._meta.get_fields() if not isinstance(i, GenericRelation)]

def filter_address(self, queryset, name, value): # pylint: disable=unused-argument
"""Filter method for start & end addresses."""
try:
return queryset.net_in(value)
except ValidationError:
return queryset.none()


class FQDNFilterSet(BaseFilterSet, NautobotFilterSet):
"""Filter for FQDN."""
Expand Down

0 comments on commit 0c7d497

Please sign in to comment.