Jeremy Stretch %!s(int64=6) %!d(string=hai) anos
pai
achega
395f23e1d3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      netbox/dcim/models.py

+ 1 - 1
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