Attempting to create the next available prefix within a parent assigned to a VRF raises an AssertionError #1923

Closed
opened 2025-12-29 17:20:36 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Aug 8, 2018).

Environment

  • Python version: 3.5.6
  • NetBox version: 2.4.2

Steps to Reproduce

  1. Create a prefix assigned to a VRF.
  2. Make an API request to create the "next available" prefix within this prefix. For example:
curl -X POST \
-H "Authorization: Token <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json; indent=4" \
http://localhost:8000/api/ipam/prefixes/<pk>/available-prefixes/ \
--data '{"prefix_length": 26}'

Expected Behavior

A new child prefix should be created.

Observed Behavior

An exception is raised:

AssertionError: `HyperlinkedIdentityField` requires the request in the serializer context. Add `context={'request': request}` when instantiating the serializer.
Originally created by @jeremystretch on GitHub (Aug 8, 2018). ### Environment * Python version: 3.5.6 * NetBox version: 2.4.2 ### Steps to Reproduce 1. Create a prefix assigned to a VRF. 2. Make an API request to create the "next available" prefix within this prefix. For example: ``` curl -X POST \ -H "Authorization: Token <token>" \ -H "Content-Type: application/json" \ -H "Accept: application/json; indent=4" \ http://localhost:8000/api/ipam/prefixes/<pk>/available-prefixes/ \ --data '{"prefix_length": 26}' ``` ### Expected Behavior A new child prefix should be created. ### Observed Behavior An exception is raised: ``` AssertionError: `HyperlinkedIdentityField` requires the request in the serializer context. Add `context={'request': request}` when instantiating the serializer. ```
adam added the type: bugstatus: accepted labels 2025-12-29 17:20:36 +01:00
adam closed this issue 2025-12-29 17:20:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1923