min_num on formsets should not just be added to extra.
|Reported by:||melinath||Owned by:||melinath|
|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:1 Changed 10 months ago by melinath
- Needs documentation unset
- Needs tests unset
- Owner changed from nobody to melinath
- Patch needs improvement unset
- Status changed from new to assigned
comment:2 Changed 10 months ago by timo
- Cc timo added
- Severity changed from Normal to Release blocker
- Triage Stage changed from Unreviewed to Accepted
comment:4 Changed 10 months ago by melinath
- Has patch set
comment:5 Changed 10 months ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from assigned to closed