diff --git a/netbox/templates/virtualization/vminterface.html b/netbox/templates/virtualization/vminterface.html index 2fa57f4f8..8d46b52fd 100644 --- a/netbox/templates/virtualization/vminterface.html +++ b/netbox/templates/virtualization/vminterface.html @@ -47,7 +47,7 @@ Virtual Machine - {{ vminterface.parent }} + {{ vminterface.virtual_machine }} diff --git a/netbox/virtualization/models.py b/netbox/virtualization/models.py index 24e5f4e87..31ffd1ceb 100644 --- a/netbox/virtualization/models.py +++ b/netbox/virtualization/models.py @@ -447,7 +447,7 @@ class VMInterface(BaseInterface): def clean(self): # Validate untagged VLAN - if self.untagged_vlan and self.untagged_vlan.site not in [self.parent.site, None]: + if self.untagged_vlan and self.untagged_vlan.site not in [self.virtual_machine.site, None]: raise ValidationError({ 'untagged_vlan': "The untagged VLAN ({}) must belong to the same site as the interface's parent " "virtual machine, or it must be global".format(self.untagged_vlan) @@ -475,10 +475,6 @@ class VMInterface(BaseInterface): object_data=serialize_object(self) ) - @property - def parent(self): - return self.virtual_machine - @property def count_ipaddresses(self): return self.ip_addresses.count()