Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type interface filter not working since 4.1.2 #17663

Closed
ITJamie opened this issue Oct 2, 2024 · 3 comments · Fixed by #17670
Closed

Type interface filter not working since 4.1.2 #17663

ITJamie opened this issue Oct 2, 2024 · 3 comments · Fixed by #17670
Assignees
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@ITJamie
Copy link
Contributor

ITJamie commented Oct 2, 2024

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

@ITJamie ITJamie added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Oct 2, 2024
@sleepinggenius2
Copy link
Contributor

sleepinggenius2 commented Oct 2, 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: #17574

@ITJamie
Copy link
Contributor Author

ITJamie commented 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

@bctiemann bctiemann self-assigned this Oct 3, 2024
@bctiemann bctiemann added status: accepted This issue has been accepted for implementation severity: low Does not significantly disrupt application functionality, or a workaround is available and removed status: needs triage This issue is awaiting triage by a maintainer labels Oct 3, 2024
@bctiemann bctiemann added severity: medium Results in substantial degraded or broken functionality for specfic workflows and removed severity: low Does not significantly disrupt application functionality, or a workaround is available labels Oct 3, 2024
@sleepinggenius2
Copy link
Contributor

@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.

jeremystretch pushed a commit that referenced this issue Oct 3, 2024
…ing to a BooleanFilter (#17670)

* Only remove extraneous attributes from extra if changing to a BooleanField

* Add tests for MultipleChoiceField icontains and negation

* Use enum in test consistently

* Reorganize tests

* Add __empty test to base filter lookup tests

* Fix test name

* Change var name for clarity
bctiemann added a commit that referenced this issue Oct 11, 2024
…ing to a BooleanFilter (#17670)

* Only remove extraneous attributes from extra if changing to a BooleanField

* Add tests for MultipleChoiceField icontains and negation

* Use enum in test consistently

* Reorganize tests

* Add __empty test to base filter lookup tests

* Fix test name

* Change var name for clarity
jeremystretch pushed a commit to alehaa/netbox that referenced this issue Oct 11, 2024
…m extra if changing to a BooleanFilter (netbox-community#17670)

* Only remove extraneous attributes from extra if changing to a BooleanField

* Add tests for MultipleChoiceField icontains and negation

* Use enum in test consistently

* Reorganize tests

* Add __empty test to base filter lookup tests

* Fix test name

* Change var name for clarity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
3 participants