mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-16 12:38:17 -06:00
Changed to use NONCONNECTABLE_IFACE_TYPES
This commit is contained in:
parent
aed144fc19
commit
d474fa6bcf
@ -2863,38 +2863,22 @@ class Cable(ChangeLoggedModel):
|
|||||||
if (
|
if (
|
||||||
(
|
(
|
||||||
isinstance(endpoint_a, Interface) and
|
isinstance(endpoint_a, Interface) and
|
||||||
endpoint_a.type == IFACE_TYPE_VIRTUAL
|
endpoint_a.type in NONCONNECTABLE_IFACE_TYPES
|
||||||
) or
|
) or
|
||||||
(
|
(
|
||||||
isinstance(endpoint_b, Interface) and
|
isinstance(endpoint_b, Interface) and
|
||||||
endpoint_b.type == IFACE_TYPE_VIRTUAL
|
endpoint_b.type in NONCONNECTABLE_IFACE_TYPES
|
||||||
) or
|
) or
|
||||||
(
|
(
|
||||||
isinstance(self.termination_a, Interface) and
|
isinstance(self.termination_a, Interface) and
|
||||||
self.termination_a.type == IFACE_TYPE_VIRTUAL
|
self.termination_a.type in NONCONNECTABLE_IFACE_TYPES
|
||||||
) or
|
) or
|
||||||
(
|
(
|
||||||
isinstance(self.termination_b, Interface) and
|
isinstance(self.termination_b, Interface) and
|
||||||
self.termination_b.type == IFACE_TYPE_VIRTUAL
|
self.termination_b.type in NONCONNECTABLE_IFACE_TYPES
|
||||||
) or
|
|
||||||
(
|
|
||||||
isinstance(endpoint_b, Interface) and
|
|
||||||
endpoint_b.type in WIRELESS_IFACE_TYPES
|
|
||||||
) or
|
|
||||||
(
|
|
||||||
isinstance(endpoint_b, Interface) and
|
|
||||||
endpoint_b.type in WIRELESS_IFACE_TYPES
|
|
||||||
) or
|
|
||||||
(
|
|
||||||
isinstance(self.termination_a, Interface) and
|
|
||||||
self.termination_a.type in WIRELESS_IFACE_TYPES
|
|
||||||
) or
|
|
||||||
(
|
|
||||||
isinstance(self.termination_b, Interface) and
|
|
||||||
self.termination_b.type in WIRELESS_IFACE_TYPES
|
|
||||||
)
|
)
|
||||||
):
|
):
|
||||||
raise ValidationError("Cannot connect to a virtual interface")
|
raise ValidationError("Cannot connect to a virtual or wireless interface")
|
||||||
|
|
||||||
# Validate length and length_unit
|
# Validate length and length_unit
|
||||||
if self.length is not None and self.length_unit is None:
|
if self.length is not None and self.length_unit is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user