prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add Device Name Filter to Secrets API
  Filter secrets by the devices they're associated to.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `netbox/secrets/filters.py`
  Content:
  ```
  1 import django_filters
  2 
  3 from .models import Secret, SecretRole
  4 
  5 
  6 class SecretFilter(django_filters.FilterSet):
  7     role_id = django_filters.ModelMultipleChoiceFilter(
  8         name='role',
  9         queryset=SecretRole.objects.all(),
  10         label='Role (ID)',
  11     )
  12     role = django_filters.ModelMultipleChoiceFilter(
  13         name='role',
  14         queryset=SecretRole.objects.all(),
  15         to_field_name='slug',
  16         label='Role (slug)',
  17     )
  18 
  19     class Meta:
  20         model = Secret
  21         fields = ['name', 'role_id', 'role']
  22
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/netbox/secrets/filters.py b/netbox/secrets/filters.py
  --- 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 @@
           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']
  
verification_info: {"golden_diff": "diff --git a/netbox/secrets/filters.py b/netbox/secrets/filters.py\n--- a/netbox/secrets/filters.py\n+++ b/netbox/secrets/filters.py\n@@ -1,6 +1,7 @@\n import django_filters\n \n from .models import Secret, SecretRole\n+from dcim.models import Device\n \n \n class SecretFilter(django_filters.FilterSet):\n@@ -15,7 +16,13 @@\n         to_field_name='slug',\n         label='Role (slug)',\n     )\n+    device = django_filters.ModelMultipleChoiceFilter(\n+        name='device',\n+        queryset=Device.objects.all(),\n+        to_field_name='name',\n+        label='Device (Name)',\n+    )\n \n     class Meta:\n         model = Secret\n-        fields = ['name', 'role_id', 'role']\n+        fields = ['name', 'role_id', 'role', 'device']\n", "issue": "Add Device Name Filter to Secrets API\nFilter secrets by the devices they're associated to.\n\n", "before_files": [{"content": "import django_filters\n\nfrom .models import Secret, SecretRole\n\n\nclass SecretFilter(django_filters.FilterSet):\n    role_id = django_filters.ModelMultipleChoiceFilter(\n        name='role',\n        queryset=SecretRole.objects.all(),\n        label='Role (ID)',\n    )\n    role = django_filters.ModelMultipleChoiceFilter(\n        name='role',\n        queryset=SecretRole.objects.all(),\n        to_field_name='slug',\n        label='Role (slug)',\n    )\n\n    class Meta:\n        model = Secret\n        fields = ['name', 'role_id', 'role']\n", "path": "netbox/secrets/filters.py"}], "after_files": [{"content": "import django_filters\n\nfrom .models import Secret, SecretRole\nfrom dcim.models import Device\n\n\nclass SecretFilter(django_filters.FilterSet):\n    role_id = django_filters.ModelMultipleChoiceFilter(\n        name='role',\n        queryset=SecretRole.objects.all(),\n        label='Role (ID)',\n    )\n    role = django_filters.ModelMultipleChoiceFilter(\n        name='role',\n        queryset=SecretRole.objects.all(),\n        to_field_name='slug',\n        label='Role (slug)',\n    )\n    device = django_filters.ModelMultipleChoiceFilter(\n        name='device',\n        queryset=Device.objects.all(),\n        to_field_name='name',\n        label='Device (Name)',\n    )\n\n    class Meta:\n        model = Secret\n        fields = ['name', 'role_id', 'role', 'device']\n", "path": "netbox/secrets/filters.py"}]}