From 9198a0490a64113b30f7fcb5170907f2bc519160 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 1 Dec 2025 12:25:34 -0500 Subject: [PATCH] Remove obsolete form validation logic --- netbox/dcim/forms/object_create.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/netbox/dcim/forms/object_create.py b/netbox/dcim/forms/object_create.py index 5f0495c76..8e0818326 100644 --- a/netbox/dcim/forms/object_create.py +++ b/netbox/dcim/forms/object_create.py @@ -127,26 +127,6 @@ class FrontPortTemplateCreateForm(ComponentCreateForm, model_forms.FrontPortTemp 'device_type', 'module_type', 'type', 'color', 'positions', 'description', ) - def clean(self): - # TODO - # super(ComponentCreateForm, self).clean() - - # Check that the number of FrontPortTemplates to be created matches the selected number of RearPortTemplate - # positions - positions = self.cleaned_data['positions'] - frontport_count = len(self.cleaned_data['name']) - rearport_count = len(self.cleaned_data['rear_ports']) - if frontport_count * positions != rearport_count: - raise forms.ValidationError({ - 'rear_ports': _( - "The number of front port templates to be created ({frontport_count}) must match the selected " - "number of rear port positions ({rearport_count})." - ).format( - frontport_count=frontport_count, - rearport_count=rearport_count - ) - }) - def get_iterative_data(self, iteration): positions = self.cleaned_data['positions'] offset = positions * iteration