Filtering device components by device name accepts only one value #3130

Closed
opened 2025-12-29 18:25:58 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jan 8, 2020).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.11

Steps to Reproduce

  1. Create at least two devices named device1 and device2
  2. Create one console port on each device
  3. Make a request for GET /api/dcim/console-ports/?name=device1&name=device2

Expected Behavior

Both console ports should be returned.

Observed Behavior

Only the console port belonging to device2 is returned.

This is caused by an error in the device filter on DeviceComponentFilterSet: It should be a ModelMultipleChoiceFilter to allow passing multiple values.

This bug affects all device components except for interfaces, as well as inventory items.

Originally created by @jeremystretch on GitHub (Jan 8, 2020). ### Environment * Python version: 3.6.8 * NetBox version: 2.6.11 ### Steps to Reproduce 1. Create at least two devices named `device1` and `device2` 2. Create one console port on each device 3. Make a request for `GET /api/dcim/console-ports/?name=device1&name=device2` ### Expected Behavior Both console ports should be returned. ### Observed Behavior Only the console port belonging to `device2` is returned. This is caused by an error in the `device` filter on DeviceComponentFilterSet: It should be a ModelMultipleChoiceFilter to allow passing multiple values. This bug affects all device components except for interfaces, as well as inventory items.
adam added the type: bugstatus: accepted labels 2025-12-29 18:25:58 +01:00
adam closed this issue 2025-12-29 18:25:59 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3130