#25431 closed Bug (fixed)
ModelFormset regression in object clean() accessing a FK
Reported by: | Claude Paroz | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 1.8 |
Severity: | Release blocker | Keywords: | regression |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When a ModelForm with an inline formset is validated (at least when all objects are new), the inline instances are constructed without the link to their parent model, because the fk field is excluded from the instance construction (see BaseModelForm._post_clean).
Like #25349, this regression is probably caused by 45e049937d2564d11035827ca9a9221b86215e45/#13776.
Change History (6)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Has patch: | set |
---|
If the patch gets approved, I'd like to tentatively backport this to 1.8.
comment:3 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
Just apply that patch to reproduce the problem in Django's test suite:
tests/model_formsets/models.py