mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Make sure we bail out if field validation failed when importing modules * Tweak form validation logic Co-authored-by: jeremystretch <jstretch@ns1.com>
This commit is contained in:
@ -961,7 +961,7 @@ class Module(PrimaryModel, ConfigContextModel):
|
||||
def clean(self):
|
||||
super().clean()
|
||||
|
||||
if self.module_bay.device != self.device:
|
||||
if hasattr(self, "module_bay") and (self.module_bay.device != self.device):
|
||||
raise ValidationError(
|
||||
f"Module must be installed within a module bay belonging to the assigned device ({self.device})."
|
||||
)
|
||||
|
Reference in New Issue
Block a user