diff options
| author | SaJH <wogur981208@gmail.com> | 2025-08-18 23:40:54 +0900 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-08-25 10:05:45 +0200 |
| commit | 3ba24c18e70dd242ae237fd955fb8be30f99bc4d (patch) | |
| tree | 8b65f66c4c8776c3f0b1315fdca5fef7ecaff494 /django/forms/models.py | |
| parent | 165ad74c578f94f962624a40dff14e1b2e23a1f8 (diff) | |
Fixed #36251 -- Avoided mutating form Meta.fields in BaseInlineFormSet.
Signed-off-by: SaJH <wogur981208@gmail.com>
Diffstat (limited to 'django/forms/models.py')
| -rw-r--r-- | django/forms/models.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/django/forms/models.py b/django/forms/models.py index 4c7db27360..104369c0b0 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -1137,8 +1137,7 @@ class BaseInlineFormSet(BaseModelFormSet): # Add the inline foreign key field to form._meta.fields if it's defined # to make sure validation isn't skipped on that field. if self.form._meta.fields and self.fk.name not in self.form._meta.fields: - if isinstance(self.form._meta.fields, tuple): - self.form._meta.fields = list(self.form._meta.fields) + self.form._meta.fields = list(self.form._meta.fields) self.form._meta.fields.append(self.fk.name) def initial_form_count(self): |
