mirror of
https://github.com/django/django.git
synced 2025-11-19 11:15:44 +00:00
Clarified "inline foreign key" to avoid confusion with generated fields in django/forms/models.py.
Some checks are pending
Linters / flake8 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
Docs / spelling (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Some checks are pending
Linters / flake8 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
Docs / spelling (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
This commit is contained in:
parent
d6a8e5f5e1
commit
dd15f7dabb
1 changed files with 2 additions and 2 deletions
|
|
@ -1134,8 +1134,8 @@ class BaseInlineFormSet(BaseModelFormSet):
|
|||
self.unique_fields = {self.fk.name}
|
||||
super().__init__(data, files, prefix=prefix, queryset=qs, **kwargs)
|
||||
|
||||
# Add the generated field to form._meta.fields if it's defined to make
|
||||
# sure validation isn't skipped on that field.
|
||||
# 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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue