From 211c7641c182b53990be7a4186d04a342e53de57 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 7 Sep 2022 14:41:48 -0400 Subject: [PATCH] Fixes #10250: Fix exception when CableTermination validation fails during bulk import of cables --- netbox/dcim/models/cables.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/netbox/dcim/models/cables.py b/netbox/dcim/models/cables.py index ab1fe88e4..e05eb6d51 100644 --- a/netbox/dcim/models/cables.py +++ b/netbox/dcim/models/cables.py @@ -281,15 +281,11 @@ class CableTermination(models.Model): # Validate interface type (if applicable) if self.termination_type.model == 'interface' and self.termination.type in NONCONNECTABLE_IFACE_TYPES: - raise ValidationError({ - 'termination': f'Cables cannot be terminated to {self.termination.get_type_display()} interfaces' - }) + raise ValidationError(f"Cables cannot be terminated to {self.termination.get_type_display()} interfaces") # A CircuitTermination attached to a ProviderNetwork cannot have a Cable if self.termination_type.model == 'circuittermination' and self.termination.provider_network is not None: - raise ValidationError({ - 'termination': "Circuit terminations attached to a provider network may not be cabled." - }) + raise ValidationError("Circuit terminations attached to a provider network may not be cabled.") def save(self, *args, **kwargs):