mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #5035: Fix exception when modifying an IP address assigned to a VM
This commit is contained in:
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
* [#5035](https://github.com/netbox-community/netbox/issues/5035) - Fix exception when modifying an IP address assigned to a VM
|
||||||
* [#5038](https://github.com/netbox-community/netbox/issues/5038) - Fix validation of primary IPs assigned to virtual machines
|
* [#5038](https://github.com/netbox-community/netbox/issues/5038) - Fix validation of primary IPs assigned to virtual machines
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -745,7 +745,7 @@ class IPAddress(ChangeLoggedModel, CustomFieldModel):
|
|||||||
'vminterface': f"IP address is primary for virtual machine {vm} but not assigned to an "
|
'vminterface': f"IP address is primary for virtual machine {vm} but not assigned to an "
|
||||||
f"interface"
|
f"interface"
|
||||||
})
|
})
|
||||||
elif self.interface.virtual_machine != vm:
|
elif self.assigned_object.virtual_machine != vm:
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'vminterface': f"IP address is primary for virtual machine {vm} but assigned to "
|
'vminterface': f"IP address is primary for virtual machine {vm} but assigned to "
|
||||||
f"{self.assigned_object.virtual_machine} ({self.assigned_object})"
|
f"{self.assigned_object.virtual_machine} ({self.assigned_object})"
|
||||||
|
Reference in New Issue
Block a user