mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-20 04:12:25 -06:00
#10172 fixes for Django 4.1
This commit is contained in:
@@ -268,7 +268,7 @@ class DeviceType(NetBoxModel):
|
||||
|
||||
if (
|
||||
self.subdevice_role != SubdeviceRoleChoices.ROLE_PARENT
|
||||
) and self.devicebaytemplates.count():
|
||||
) and self.pk and self.devicebaytemplates.count():
|
||||
raise ValidationError({
|
||||
'subdevice_role': "Must delete all device bay templates associated with this device before "
|
||||
"declassifying it as a parent device."
|
||||
|
||||
Reference in New Issue
Block a user