Inconsistent role requirement on virtual machine between API and WebUI #4168
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
Uh oh!
There was an error while loading. Please reload this page.
Environment
Steps to Reproduce
Expected Behavior
If a role for a virtual machine is required or not should be the same for API and WebUI.
Observed Behavior
If you create a virtual machine by API, role isn't required.
If you create a virtual machine in the WebUI, role is required.
The VirtualMachine model defines
blank=True
andnull=True
, which makes role not required by API:https://github.com/netbox-community/netbox/blob/v2.7.6/netbox/virtualization/models.py#L212-L219
The VirtualMachineForm doesn't have a
required=False
for role, which makes role required in the WebUI:https://github.com/netbox-community/netbox/blob/v2.7.6/netbox/virtualization/forms.py#L352-L360
The text was updated successfully, but these errors were encountered: