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

Device component filter search returns full queryset #9061

Closed
DanSheps opened this issue Apr 6, 2022 · 1 comment
Closed

Device component filter search returns full queryset #9061

DanSheps opened this issue Apr 6, 2022 · 1 comment
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@DanSheps
Copy link
Member

DanSheps commented Apr 6, 2022

NetBox version

3.2.0

Python version

3.9

Steps to Reproduce

  1. Create a site
  2. Create a manufacturer
  3. Create a device type
  4. Create a device role
  5. Create a device
  6. Add components to device (interfaces: Gi1/0/1-48)
  7. Attempt to filter on 1/0/20

Expected Behavior

Only Gi1/0/20 will be returned

Observed Behavior

Full unfiltered queryset is returned

@DanSheps DanSheps added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Apr 6, 2022
@DanSheps DanSheps self-assigned this Apr 6, 2022
@DanSheps
Copy link
Member Author

DanSheps commented Apr 6, 2022

This is due to the fact that search() is not overridden from the NetBoxModelFilterSet due to the inheritance ordering. By default, NetBoxModelFilterSet returns the full queryset.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

1 participant