mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #8724: Fix exception during device import with invalid device type
This commit is contained in:
parent
6423b386d2
commit
81610ba86e
@ -20,6 +20,7 @@
|
|||||||
* [#8710](https://github.com/netbox-community/netbox/issues/8710) - Fix dynamic scope selection form fields when creating a VLAN group
|
* [#8710](https://github.com/netbox-community/netbox/issues/8710) - Fix dynamic scope selection form fields when creating a VLAN group
|
||||||
* [#8713](https://github.com/netbox-community/netbox/issues/8713) - Restore missing "add" button on services list view
|
* [#8713](https://github.com/netbox-community/netbox/issues/8713) - Restore missing "add" button on services list view
|
||||||
* [#8717](https://github.com/netbox-community/netbox/issues/8717) - Fix redirection after bulk edit/delete of prefixes from aggregate view
|
* [#8717](https://github.com/netbox-community/netbox/issues/8717) - Fix redirection after bulk edit/delete of prefixes from aggregate view
|
||||||
|
* [#8724](https://github.com/netbox-community/netbox/issues/8724) - Fix exception during device import with invalid device type
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -670,6 +670,7 @@ class Device(PrimaryModel, ConfigContextModel):
|
|||||||
})
|
})
|
||||||
|
|
||||||
# Prevent 0U devices from being assigned to a specific position
|
# Prevent 0U devices from being assigned to a specific position
|
||||||
|
if hasattr(self, 'device_type'):
|
||||||
if self.position and self.device_type.u_height == 0:
|
if self.position and self.device_type.u_height == 0:
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'position': f"A U0 device type ({self.device_type}) cannot be assigned to a rack position."
|
'position': f"A U0 device type ({self.device_type}) cannot be assigned to a rack position."
|
||||||
|
Loading…
Reference in New Issue
Block a user