mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-21 03:27:21 -06:00
Merge pull request #10341 from netbox-community/10172-upgrade-django
10172 upgrade django
This commit is contained in:
commit
cd5581aada
@ -4,7 +4,7 @@ bleach
|
|||||||
|
|
||||||
# The Python web framework on which NetBox is built
|
# The Python web framework on which NetBox is built
|
||||||
# https://github.com/django/django
|
# https://github.com/django/django
|
||||||
Django<4.1
|
Django<4.2
|
||||||
|
|
||||||
# Django middleware which permits cross-domain API requests
|
# Django middleware which permits cross-domain API requests
|
||||||
# https://github.com/OttoYiu/django-cors-headers
|
# https://github.com/OttoYiu/django-cors-headers
|
||||||
|
@ -953,12 +953,13 @@ class RearPort(ModularComponentModel, CabledObjectModel):
|
|||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
# Check that positions count is greater than or equal to the number of associated FrontPorts
|
# Check that positions count is greater than or equal to the number of associated FrontPorts
|
||||||
frontport_count = self.frontports.count()
|
if self.pk:
|
||||||
if self.positions < frontport_count:
|
frontport_count = self.frontports.count()
|
||||||
raise ValidationError({
|
if self.positions < frontport_count:
|
||||||
"positions": f"The number of positions cannot be less than the number of mapped front ports "
|
raise ValidationError({
|
||||||
f"({frontport_count})"
|
"positions": f"The number of positions cannot be less than the number of mapped front ports "
|
||||||
})
|
f"({frontport_count})"
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -268,7 +268,7 @@ class DeviceType(NetBoxModel):
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
self.subdevice_role != SubdeviceRoleChoices.ROLE_PARENT
|
self.subdevice_role != SubdeviceRoleChoices.ROLE_PARENT
|
||||||
) and self.devicebaytemplates.count():
|
) and self.pk and self.devicebaytemplates.count():
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'subdevice_role': "Must delete all device bay templates associated with this device before "
|
'subdevice_role': "Must delete all device bay templates associated with this device before "
|
||||||
"declassifying it as a parent device."
|
"declassifying it as a parent device."
|
||||||
|
@ -367,7 +367,7 @@ class VirtualMachine(NetBoxModel, ConfigContextModel):
|
|||||||
})
|
})
|
||||||
|
|
||||||
# Validate primary IP addresses
|
# Validate primary IP addresses
|
||||||
interfaces = self.interfaces.all()
|
interfaces = self.interfaces.all() if self.pk else None
|
||||||
for family in (4, 6):
|
for family in (4, 6):
|
||||||
field = f'primary_ip{family}'
|
field = f'primary_ip{family}'
|
||||||
ip = getattr(self, field)
|
ip = getattr(self, field)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
bleach==5.0.1
|
bleach==5.0.1
|
||||||
Django==4.0.7
|
Django==4.1.1
|
||||||
django-cors-headers==3.13.0
|
django-cors-headers==3.13.0
|
||||||
django-debug-toolbar==3.6.0
|
django-debug-toolbar==3.6.0
|
||||||
django-filter==22.1
|
django-filter==22.1
|
||||||
|
Loading…
Reference in New Issue
Block a user