Can't create new sitegroup with parent using REST api #6258
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
NetBox version
v2.11.0
Python version
3.6
Steps to Reproduce
Post a new sitegroup to api/dcim/site-groups/ with data {"name":"name","slug":"slug","parent":< id >} where parent is id of an existing sitegroup.
Expected Behavior
A new sitegroup should have been created with parent showing the sitegroup where parent refers to.
Observed Behavior
A 500 Internal Error is returned.
{
"error": "Cannot assign "<Region: Region1>": "SiteGroup.parent" must be a "SiteGroup" instance.",
"exception": "ValueError",
"netbox_version": "2.11.0",
"python_version": "3.6.9"
}
Bug is already detected in the code here: https://github.com/netbox-community/netbox/blob/master/netbox/dcim/api/serializers.py#L93
But it's not sure if it's the only cause.
The text was updated successfully, but these errors were encountered: