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

Using VRF object instead of id in POST to api/ipam/prefixes/<pk>/available-ips/ #1507

Closed
alejandrosalinas opened this issue Sep 18, 2017 · 1 comment
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@alejandrosalinas
Copy link

When posting on api/ipam/prefixes//available-ips/ the code uses the entire VRF object instead of the VRF ID on the serializer.

data = request.data.copy()
data['address'] = '{}/{}'.format(ipaddress, prefix.prefix.prefixlen)
data['vrf'] = prefix.vrf                                                  <=== HERE
serializer = serializers.WritableIPAddressSerializer(data=data)

which then fails with

"Incorrect type. Expected pk value, received VRF."

@alejandrosalinas alejandrosalinas changed the title Using VRF object instead id in POST to api/ipam/prefixes/<pk>/available-ips/ Using VRF object instead of id in POST to api/ipam/prefixes/<pk>/available-ips/ Sep 18, 2017
@jeremystretch jeremystretch added the type: bug A confirmed report of unexpected behavior in the application label Sep 18, 2017
@jeremystretch
Copy link
Member

Thank you for the bug report, but in the future please be sure to use the issue template.

lampwins pushed a commit to lampwins/netbox that referenced this issue Oct 13, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants