-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.2.0
Python version
3.9
Steps to Reproduce
- Create two VMs, e.g.
vm1andvm2 - On each VM create an Interface, e.g.
parent - Use UI
/virtualization/interfaces/import/with the following content to create a child interface onvm1:
virtual_machine,parent,name
vm1,parent,child
- Submit
- Use UI
/virtualization/interfaces/import/with the following content to create the same child onvm2:
virtual_machine,parent,name
vm2,parent,child
- Submit
Expected Behavior
vm2 should have two interfaces:
parentchild, which hasparentas parent
Observed Behavior
An error is returned:
Row 1 parent: "parent" is not a unique value for this field; multiple objects were found
It seems the Queryset used for fetching the parent interface does not include the VM for narrowing down and therefore all interfaces with the searched name are returned.
As only one is expected, this leads to Django raising MultipleObjectsReturned and NetBox reraising it as forms.ValidationError.
Looks like the same error as in in #8546 that got Fixes for v3.1.9 in 6bbf168 for dcim.interface is present for virtualization.interface.
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application