min_num on formsets should not just be added to extra.
|Reported by:||melinath||Owned by:||melinath|
|Cc:||Tim Graham||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The current implementation is slightly broken.
I would set min_num=3 if there should be at least three things. I would set extra=3 if I wanted three blank forms presented.
The implementation that was added in 1.7 means that there will *always* be six blank forms - initial data is *not* taken into account.
To put it another way, if min_num is 3, and extra is 2, and there is initial data for two forms, I would expect to have either 4 forms (2 extra on top of existing objects) or 5 forms (2 extra on top of the minimum.) With the code as it is, I will instead get seven forms - two for the existing objects, and an additional seven from extra.
See note on #9532.
(Is this a release blocker, since it's a bug in a new feature?)
Change History (6)
comment:2 Changed 3 years ago by
|Cc:||Tim Graham added|
|Severity:||Normal → Release blocker|
|Triage Stage:||Unreviewed → Accepted|