mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 05:28:16 -06:00
Fix test to check for PK
This commit is contained in:
parent
9374890724
commit
ec58b5338f
@ -369,6 +369,7 @@ class IPAddressForm(TenancyForm, NetBoxModelForm):
|
|||||||
'primary_for_parent', _("Only IP addresses assigned to an interface can be designated as primary IPs.")
|
'primary_for_parent', _("Only IP addresses assigned to an interface can be designated as primary IPs.")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.instance.pk:
|
||||||
prev_interface = self.instance.interface.first() or self.instance.vminterface.first()
|
prev_interface = self.instance.interface.first() or self.instance.vminterface.first()
|
||||||
# If the prev interface exists and does not match the new interface, we need to validate it isn't set as primary
|
# If the prev interface exists and does not match the new interface, we need to validate it isn't set as primary
|
||||||
# for the parent
|
# for the parent
|
||||||
|
Loading…
Reference in New Issue
Block a user