mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Fixes #2491: Fix exception when importing devices with invalid device type
This commit is contained in:
parent
5d10d8418e
commit
841db3b0c2
@ -10,6 +10,7 @@ v2.4.6 (FUTURE)
|
|||||||
* [#2483](https://github.com/digitalocean/netbox/issues/2483) - Set max item count of API-populated form fields to MAX_PAGE_SIZE
|
* [#2483](https://github.com/digitalocean/netbox/issues/2483) - Set max item count of API-populated form fields to MAX_PAGE_SIZE
|
||||||
* [#2484](https://github.com/digitalocean/netbox/issues/2484) - Local config context not available on the Virtual Machine Edit Form
|
* [#2484](https://github.com/digitalocean/netbox/issues/2484) - Local config context not available on the Virtual Machine Edit Form
|
||||||
* [#2485](https://github.com/digitalocean/netbox/issues/2485) - Fix cancel button when assigning a service to a device/VM
|
* [#2485](https://github.com/digitalocean/netbox/issues/2485) - Fix cancel button when assigning a service to a device/VM
|
||||||
|
* [#2491](https://github.com/digitalocean/netbox/issues/2491) - Fix exception when importing devices with invalid device type
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1400,7 +1400,7 @@ class Device(ChangeLoggedModel, ConfigContextModel, CustomFieldModel):
|
|||||||
})
|
})
|
||||||
|
|
||||||
# Validate manufacturer/platform
|
# Validate manufacturer/platform
|
||||||
if self.device_type and self.platform:
|
if hasattr(self, 'device_type') and self.platform:
|
||||||
if self.platform.manufacturer and self.platform.manufacturer != self.device_type.manufacturer:
|
if self.platform.manufacturer and self.platform.manufacturer != self.device_type.manufacturer:
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'platform': "The assigned platform is limited to {} device types, but this device's type belongs "
|
'platform': "The assigned platform is limited to {} device types, but this device's type belongs "
|
||||||
|
Loading…
Reference in New Issue
Block a user