mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
12255 inventory item device change (#12311)
* #12255 allow inventory items to change devices * #12255 allow inventory item template to change devices * #12255 fix init * 12255 remove can_swtich from template model * 12255 change to check module list
This commit is contained in:
@@ -97,7 +97,8 @@ class ComponentModel(NetBoxModel):
|
||||
def clean(self):
|
||||
super().clean()
|
||||
|
||||
if self.pk is not None and self._original_device != self.device_id:
|
||||
# Check list of Modules that allow device field to be changed
|
||||
if (type(self) not in [InventoryItem]) and (self.pk is not None) and (self._original_device != self.device_id):
|
||||
raise ValidationError({
|
||||
"device": "Components cannot be moved to a different device."
|
||||
})
|
||||
|
Reference in New Issue
Block a user