Filtering on multiple inputs in custom scripts only returns last input #5299

Closed
opened 2025-12-29 19:26:24 +01:00 by adam · 1 comment
Owner

Originally created by @rodvand on GitHub (Sep 2, 2021).

Originally assigned to: @thatmattlove on GitHub.

NetBox version

v3.0.1

Python version

3.8

Steps to Reproduce

1 Create a custom script with the following code

class Test:
  device = ObjectVar(
    model = Device,
    query_params = {
      "name__ic": ["akron-pdu01", "akron-rtr01"]
    },
  )

  class run(self, data, commit):
    pass

Expected Behavior

In the device dropdown menu to see devices "dmi01-akron-pdu01" and "dmi01-akron-rtr01".

Observed Behavior

Only the device "dmi01-akron-rtr01" is shown. If you use developer tools to see the requests you can see the request only using the last device in the query.

This bug report is a copy of https://github.com/netbox-community/netbox/issues/6990 as it is the exact same issue I'm seeing on 3.0.1. While not 100% sure I believe it worked as expected in 3.0.0.

Originally created by @rodvand on GitHub (Sep 2, 2021). Originally assigned to: @thatmattlove on GitHub. ### NetBox version v3.0.1 ### Python version 3.8 ### Steps to Reproduce 1 Create a custom script with the following code ``` class Test: device = ObjectVar( model = Device, query_params = { "name__ic": ["akron-pdu01", "akron-rtr01"] }, ) class run(self, data, commit): pass ``` ### Expected Behavior In the device dropdown menu to see devices "dmi01-akron-pdu01" and "dmi01-akron-rtr01". ### Observed Behavior Only the device "dmi01-akron-rtr01" is shown. If you use developer tools to see the requests you can see the request only using the last device in the query. This bug report is a copy of https://github.com/netbox-community/netbox/issues/6990 as it is the exact same issue I'm seeing on 3.0.1. While not 100% sure I believe it worked as expected in 3.0.0.
adam added the type: bugstatus: accepted labels 2025-12-29 19:26:24 +01:00
adam closed this issue 2025-12-29 19:26:24 +01:00
Author
Owner

@thatmattlove commented on GitHub (Sep 2, 2021):

Thanks @rodvand - this was a regression from 5b87232, I've re-fixed it via 113358f

@thatmattlove commented on GitHub (Sep 2, 2021): Thanks @rodvand - this was a regression from 5b87232, I've re-fixed it via 113358f
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5299