summaryrefslogtreecommitdiff
path: root/django/forms/formsets.py
diff options
context:
space:
mode:
authorantoliny0919 <antoliny0919@gmail.com>2024-11-17 11:25:44 +0900
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-11-20 11:36:33 +0100
commitf60d5e46e131b94d6ecc92b6891689ccc94bd1c9 (patch)
treeaf5c70212bc060117a20c58805f3721c79ad1fb6 /django/forms/formsets.py
parent4c452cc377f6f43acd90c6e54826ebd2e6219b0d (diff)
Fixed #35913 -- Prevented formset name suffix 'FormFormSet'.
Diffstat (limited to 'django/forms/formsets.py')
-rw-r--r--django/forms/formsets.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/django/forms/formsets.py b/django/forms/formsets.py
index c8e5893f19..c2663154d4 100644
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -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):