From e74d48722b55855888ee13720fdec800d24da0ac Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Tue, 1 Apr 2025 17:01:24 +0200 Subject: [PATCH] fix(forms): Call super().clean() in clean methods Adds a call to super().clean() in the clean methods of object creation forms. This ensures base class validation logic is executed properly before custom logic is applied. Fixes #19041 --- netbox/dcim/forms/object_create.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netbox/dcim/forms/object_create.py b/netbox/dcim/forms/object_create.py index 6f6cd8f7c..b279aec9b 100644 --- a/netbox/dcim/forms/object_create.py +++ b/netbox/dcim/forms/object_create.py @@ -153,6 +153,7 @@ class FrontPortTemplateCreateForm(ComponentCreateForm, model_forms.FrontPortTemp self.fields['rear_port'].choices = choices def clean(self): + super().clean() # Check that the number of FrontPortTemplates to be created matches the selected number of RearPortTemplate # positions @@ -302,6 +303,7 @@ class FrontPortCreateForm(ComponentCreateForm, model_forms.FrontPortForm): self.fields['rear_port'].choices = choices def clean(self): + super().clean() # Check that the number of FrontPorts to be created matches the selected number of RearPort positions frontport_count = len(self.cleaned_data['name'])