diff --git a/netbox/secrets/filters.py b/netbox/secrets/filters.py index 0773562e641..4606b3db5b9 100644 --- a/netbox/secrets/filters.py +++ b/netbox/secrets/filters.py @@ -1,6 +1,7 @@ import django_filters from .models import Secret, SecretRole +from dcim.models import Device class SecretFilter(django_filters.FilterSet): @@ -15,7 +16,13 @@ class SecretFilter(django_filters.FilterSet): to_field_name='slug', label='Role (slug)', ) + device = django_filters.ModelMultipleChoiceFilter( + name='device', + queryset=Device.objects.all(), + to_field_name='name', + label='Device (Name)', + ) class Meta: model = Secret - fields = ['name', 'role_id', 'role'] + fields = ['name', 'role_id', 'role', 'device']