mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #2777: Fix cable validation to handle duplicate connections on import
This commit is contained in:
parent
c89735cd4e
commit
dd5f37391f
@ -15,6 +15,7 @@ v2.5.3 (FUTURE)
|
|||||||
* [#2742](https://github.com/digitalocean/netbox/issues/2742) - Preserve cluster assignment when editing a device
|
* [#2742](https://github.com/digitalocean/netbox/issues/2742) - Preserve cluster assignment when editing a device
|
||||||
* [#2757](https://github.com/digitalocean/netbox/issues/2757) - Always treat first/last IPs within a /31 or /127 as usable
|
* [#2757](https://github.com/digitalocean/netbox/issues/2757) - Always treat first/last IPs within a /31 or /127 as usable
|
||||||
* [#2762](https://github.com/digitalocean/netbox/issues/2762) - Add missing DCIM field values to API `_choices` endpoint
|
* [#2762](https://github.com/digitalocean/netbox/issues/2762) - Add missing DCIM field values to API `_choices` endpoint
|
||||||
|
* [#2777](https://github.com/digitalocean/netbox/issues/2777) - Fix cable validation to handle duplicate connections on import
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -2558,9 +2558,12 @@ class Cable(ChangeLoggedModel):
|
|||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
|
||||||
# Check that termination types are compatible
|
if self.termination_a and self.termination_b:
|
||||||
|
|
||||||
type_a = self.termination_a_type.model
|
type_a = self.termination_a_type.model
|
||||||
type_b = self.termination_b_type.model
|
type_b = self.termination_b_type.model
|
||||||
|
|
||||||
|
# Check that termination types are compatible
|
||||||
if type_b not in COMPATIBLE_TERMINATION_TYPES.get(type_a):
|
if type_b not in COMPATIBLE_TERMINATION_TYPES.get(type_a):
|
||||||
raise ValidationError("Incompatible termination types: {} and {}".format(
|
raise ValidationError("Incompatible termination types: {} and {}".format(
|
||||||
self.termination_a_type, self.termination_b_type
|
self.termination_a_type, self.termination_b_type
|
||||||
|
Loading…
Reference in New Issue
Block a user