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

Can't create new sitegroup with parent using REST api #6258

Closed
PeterO2 opened this issue Apr 23, 2021 · 0 comments
Closed

Can't create new sitegroup with parent using REST api #6258

PeterO2 opened this issue Apr 23, 2021 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@PeterO2
Copy link

PeterO2 commented Apr 23, 2021

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.

@PeterO2 PeterO2 added the type: bug A confirmed report of unexpected behavior in the application label Apr 23, 2021
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Apr 23, 2021
@jeremystretch jeremystretch self-assigned this Apr 23, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2021
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

No branches or pull requests

2 participants