Corrected current_bay condition

This commit is contained in:
hSaria 2020-01-02 14:08:18 +00:00 committed by GitHub
parent a373ce9f66
commit 0a124073ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 != 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