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

inventory-items requires parent but not really #1818

Closed
Ichabond opened this issue Jan 11, 2018 · 0 comments
Closed

inventory-items requires parent but not really #1818

Ichabond opened this issue Jan 11, 2018 · 0 comments
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@Ichabond
Copy link
Contributor

Ichabond commented Jan 11, 2018

Issue type

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

Environment

  • Python version: 3.5.2
  • NetBox version: 2.2.7

Description

When doing a POST request to the /api/dcim/inventory-items endpoint with the following payload:

{'device': 1000, 'name': "EXAMPLE", 'description': "EXAMPLE", 'serial': "J219091", 'manufacturer': 1, 'part_id': "JOQ"}

It fails, with the following message:

{"name": "EXAMPLE", "description": "EXAMPLE", "part_id": "JOQ", "device": 1000, "serial": "J219091", "manufacturer": 1}, {"parent":["This field is required."]

When adding an inventory item using the UI, this field is not required (it's not even exposed), and when listing the items (using GET /api/dcim/inventory-items), parent is null.

This can be worked around by explicitly setting parent to None in the payload dictionary.

@jeremystretch jeremystretch added the type: bug A confirmed report of unexpected behavior in the application label Jan 19, 2018
funzoneq added a commit to openfibernet/netbox that referenced this issue Feb 6, 2018
* Fixes netbox-community#1765: Improved rendering of null options for model choice fields in filter forms

* Fixes netbox-community#1802: Typo in ldap.md

* Fixes netbox-community#1621: Tweaked LLDP interface name evaluation logic

* Fixes netbox-community#1807: Populate VRF from parent when creating a new prefix

* Fixes netbox-community#1809: Populate tenant assignment from parent when creating a new prefix

* Closes netbox-community#1824: Add virtual machine count to platforms list

* Fixes netbox-community#1818: InventoryItem API serializer no longer requires specifying a null value for items with no parent

* Evaluate device_id rather than pulling entire device (DB optimization)

* added statement and exaple for using ForeignKey ID's in write actions

* Closes netbox-community#1828: Added warning about media directory permissions

* fixed duplicate api docs example and grammar

* Closes netbox-community#1835: Consistent position of previous/next rack buttons

* Fixes netbox-community#1845: Correct display of VMs in list with no role assigned

* Closes netbox-community#1406: Display tenant description as title text in object tables

* Closes netbox-community#1366: Enable searching for regions by name/slug

* Cleaned up InventoryItem add/edit/delete links and return URL

* Closes netbox-community#1073: Include prefixes/IPs from all VRFs when viewing the children of a container prefix in the global table

* Closes netbox-community#144: Implemented list and bulk edit/delete views for InventoryItems

* Added report results to the home page

* Fixes netbox-community#1850: Fix TypeError when attempting IP address import if only unnamed devices exist

* Added warning message about automatically deleting child inventory items

* Release v.2.2.9
@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
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants