diff --git a/netbox/wireless/models.py b/netbox/wireless/models.py index 9c73ae5b7..11f9e06eb 100644 --- a/netbox/wireless/models.py +++ b/netbox/wireless/models.py @@ -198,13 +198,13 @@ class WirelessLink(WirelessAuthenticationBase, DistanceMixin, PrimaryModel): super().clean() # Validate interface types - if self.interface_a.type not in WIRELESS_IFACE_TYPES: + if hasattr(self, "interface_a") and self.interface_a.type not in WIRELESS_IFACE_TYPES: raise ValidationError({ 'interface_a': _( "{type} is not a wireless interface." ).format(type=self.interface_a.get_type_display()) }) - if self.interface_b.type not in WIRELESS_IFACE_TYPES: + if hasattr(self, "interface_b") and self.interface_b.type not in WIRELESS_IFACE_TYPES: raise ValidationError({ 'interface_b': _( "{type} is not a wireless interface."