Skip to content

API filtering 'OR' logic not working when filtering IP addresses by device ID #3507

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

Closed
ajknv opened this issue Sep 17, 2019 · 1 comment · Fixed by #4075
Closed

API filtering 'OR' logic not working when filtering IP addresses by device ID #3507

ajknv opened this issue Sep 17, 2019 · 1 comment · Fixed by #4075
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@ajknv
Copy link
Contributor

ajknv commented Sep 17, 2019

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.3

Steps to Reproduce

Issue an API query with filter parameters specifying two different device IDs, for example:
https://netbox/api/ipam/ip-addresses/?device_id=13441&device_id=13442

Expected Behavior

API will return IP addresses associated with the devices having ids 13441 and 13442.

Observed Behavior

API returned only the IP addresses associated with the last given device id, in this case 13442.

@DanSheps
Copy link
Member

device_id in ipam/filters.py is a NumberFilter.

This could at least be upgraded to a ModelMultipleChoiceFilter.

@DanSheps DanSheps added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application labels Sep 23, 2019
@kobayashi kobayashi self-assigned this Dec 26, 2019
@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application and removed type: feature Introduction of new functionality to the application labels Jan 16, 2020
kobayashi added a commit to kobayashi/netbox that referenced this issue Feb 2, 2020
kobayashi added a commit to kobayashi/netbox that referenced this issue Feb 9, 2020
jeremystretch added a commit that referenced this issue Feb 10, 2020
Fixes #3507: Filtering IP by multiple devices
DouglasHeriot added a commit to hillsong/ansible_modules that referenced this issue May 12, 2020
* Gets the API version, to allow working around netbox-community/netbox#3507 in tests
* While I'm at it, it also allows fetching allowed_device_query_parameters dynamically instead of hard-coding the list.
DouglasHeriot added a commit to hillsong/ansible_modules that referenced this issue May 12, 2020
* Gets the API version, to allow working around netbox-community/netbox#3507 in tests
* While I'm at it, it also allows fetching allowed_device_query_parameters dynamically instead of hard-coding the list.
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
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

Successfully merging a pull request may close this issue.

4 participants