1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#10172 fixes for Django 4.1

This commit is contained in:
Arthur
2022-09-12 09:59:37 -07:00
parent 27d72746ca
commit ce6bf9e5c1
3 changed files with 9 additions and 8 deletions

View File

@ -367,7 +367,7 @@ class VirtualMachine(NetBoxModel, ConfigContextModel):
})
# Validate primary IP addresses
interfaces = self.interfaces.all()
interfaces = self.interfaces.all() if self.pk else None
for family in (4, 6):
field = f'primary_ip{family}'
ip = getattr(self, field)