1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #3822: Fix exception when editing a device bay (regression from #3596)

This commit is contained in:
Jeremy Stretch
2020-01-02 09:26:38 -05:00
parent 8c7b0cf670
commit dd85448451
2 changed files with 2 additions and 1 deletions

View File

@@ -2597,7 +2597,7 @@ class DeviceBay(ComponentModel):
# Check that the installed device is not already installed elsewhere
if self.installed_device:
current_bay = DeviceBay.objects.filter(installed_device=self.installed_device).first()
if current_bay:
if current_bay != self:
raise ValidationError({
'installed_device': "Cannot install the specified device; device is already installed in {}".format(
current_bay