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

Fix api_filter to allow UUIDs #159

Merged
merged 1 commit into from
Aug 24, 2022
Merged

Conversation

lungj
Copy link
Contributor

@lungj lungj commented Aug 21, 2022

In the existing code, trying to filter by id leads to the id being turned into an int. However, UUIDs are actually non-integer strings, so, if anything, we should be checking that the value is a UUID.

However, I simply removed the checking entirely to preserve the behaviour of the example lookup with id=1 from the forked Netbox code.

As a result of the change, the original behaviour should be preserved as well as supporting this type of use:

{{ query('networktocode.nautobot.lookup', 'devices', api_filter='id=an_actual_uuid', api_endpoint=nautobot_endpoint, token=nautobot_token) }}

@FragmentedPacket FragmentedPacket merged commit e794da3 into nautobot:develop Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants