From 0a124073ea2c6c20d86ab77a8c2e3de71517fbd4 Mon Sep 17 00:00:00 2001 From: hSaria <34197532+hSaria@users.noreply.github.com> Date: Thu, 2 Jan 2020 14:08:18 +0000 Subject: [PATCH] Corrected current_bay condition --- netbox/dcim/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/dcim/models.py b/netbox/dcim/models.py index 6d3de7c0b..8f95fa19a 100644 --- a/netbox/dcim/models.py +++ b/netbox/dcim/models.py @@ -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 != self: + if current_bay and current_bay != self: raise ValidationError({ 'installed_device': "Cannot install the specified device; device is already installed in {}".format( current_bay