1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #35913 -- Prevented formset name suffix 'FormFormSet'.

This commit is contained in:
antoliny0919
2024-11-17 11:25:44 +09:00
committed by Sarah Boyce
parent 4c452cc377
commit f60d5e46e1
2 changed files with 12 additions and 1 deletions

View File

@@ -570,7 +570,12 @@ def formset_factory(
"validate_max": validate_max,
"renderer": renderer,
}
return type(form.__name__ + "FormSet", (formset,), attrs)
form_name = form.__name__
if form_name.endswith("Form"):
formset_name = form_name + "Set"
else:
formset_name = form_name + "FormSet"
return type(formset_name, (formset,), attrs)
def all_valid(formsets):