Type interface filter not working since 4.1.2 #10313

Closed
opened 2025-12-29 21:29:49 +01:00 by adam · 3 comments
Owner

Originally created by @ITJamie on GitHub (Oct 2, 2024).

Originally assigned to: @bctiemann on GitHub.

Deployment Type

Self-hosted

NetBox Version

V4.1.2

Python Version

3.10

Steps to Reproduce

Example urls which fail

Expected Behavior

Api response to work (fails in swagger example too)

Observed Behavior

HTTP 400 Bad Request
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE
Content-Type: application/json
Vary: Accept

{
    "type__nic": [
        "Select a valid choice. bridge is not one of the available choices."
    ]
}

Example response

Originally created by @ITJamie on GitHub (Oct 2, 2024). Originally assigned to: @bctiemann on GitHub. ### Deployment Type Self-hosted ### NetBox Version V4.1.2 ### Python Version 3.10 ### Steps to Reproduce Example urls which fail - https://demo.netbox.dev/api/dcim/interfaces/?type__isw=bridge - https://demo.netbox.dev/api/dcim/interfaces/?type__nic=bridge ### Expected Behavior Api response to work (fails in swagger example too) ### Observed Behavior ``` HTTP 400 Bad Request Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE Content-Type: application/json Vary: Accept { "type__nic": [ "Select a valid choice. bridge is not one of the available choices." ] } ``` Example response
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 21:29:49 +01:00
adam closed this issue 2025-12-29 21:29:49 +01:00
Author
Owner

@sleepinggenius2 commented on GitHub (Oct 3, 2024):

Can confirm that this is still present in 4.1.3 and seems to be a general issue with such filters on choice fields, as I just had it happen to me after upgrading from 4.1.1 with type__n on a model for a plugin I'm working on.

Pretty sure this is the change that broke it: https://github.com/netbox-community/netbox/pull/17574

@sleepinggenius2 commented on GitHub (Oct 3, 2024): Can confirm that this is still present in 4.1.3 and seems to be a general issue with such filters on choice fields, as I just had it happen to me after upgrading from 4.1.1 with `type__n` on a model for a plugin I'm working on. Pretty sure this is the change that broke it: https://github.com/netbox-community/netbox/pull/17574
Author
Owner

@ITJamie commented on GitHub (Oct 3, 2024):

I expected that change too when i was looking over the commits. Cant confirm as I'm mobile only for the next week

@ITJamie commented on GitHub (Oct 3, 2024): I expected that change too when i was looking over the commits. Cant confirm as I'm mobile only for the next week
Author
Owner

@sleepinggenius2 commented on GitHub (Oct 3, 2024):

@bctiemann I know you are still working on the PR, but I just applied your changes locally and can confirm that they resolve the issue I was having.

@sleepinggenius2 commented on GitHub (Oct 3, 2024): @bctiemann I know you are still working on the PR, but I just applied your changes locally and can confirm that they resolve the issue I was having.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10313