mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
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
This commit is contained in:
parent
bbd5e9cab9
commit
e74d48722b
@ -153,6 +153,7 @@ class FrontPortTemplateCreateForm(ComponentCreateForm, model_forms.FrontPortTemp
|
|||||||
self.fields['rear_port'].choices = choices
|
self.fields['rear_port'].choices = choices
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
super().clean()
|
||||||
|
|
||||||
# Check that the number of FrontPortTemplates to be created matches the selected number of RearPortTemplate
|
# Check that the number of FrontPortTemplates to be created matches the selected number of RearPortTemplate
|
||||||
# positions
|
# positions
|
||||||
@ -302,6 +303,7 @@ class FrontPortCreateForm(ComponentCreateForm, model_forms.FrontPortForm):
|
|||||||
self.fields['rear_port'].choices = choices
|
self.fields['rear_port'].choices = choices
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
super().clean()
|
||||||
|
|
||||||
# Check that the number of FrontPorts to be created matches the selected number of RearPort positions
|
# Check that the number of FrontPorts to be created matches the selected number of RearPort positions
|
||||||
frontport_count = len(self.cleaned_data['name'])
|
frontport_count = len(self.cleaned_data['name'])
|
||||||
|
Loading…
Reference in New Issue
Block a user