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

400 error on dcim/device-types: subdevice_role "This field may not be null" #2272

Closed
aruhier opened this issue Jul 25, 2018 · 2 comments
Closed
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@aruhier
Copy link
Contributor

aruhier commented Jul 25, 2018

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation
[ ] Housekeeping

Environment

  • Python version: 3.6
  • NetBox version: at least 2.3.3 to e82bf66

Description

  • Create or update a device type through the API by setting subdevice_role to null.
  • You should get a 400 error, containing this message: {"subdevice_role":["This field may not be null."]}

I tried to force the attribute as non required in its serializer, but it apparently didn't fix the issue.

Thanks!

@aruhier
Copy link
Contributor Author

aruhier commented Jul 25, 2018

I debugged a bit, and it seems that allow_null is set to False for the ChoiceFieldSerializer here. Forcing it to True fixes the issue.

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Jul 26, 2018
@aruhier
Copy link
Contributor Author

aruhier commented Jul 31, 2018

Thanks a lot!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 2020
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