#33822 closed Bug (fixed)
New FormSet.edit_only only set when formset created by modelformset_factory
Reported by: | Claude Paroz | Owned by: | Shawn Dong |
---|---|---|---|
Component: | Forms | Version: | 4.1 |
Severity: | Release blocker | Keywords: | |
Cc: | Vlad, Shawn Dong | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The new FormSet.edit_only
attribute (#26142) is only set from modelformset_factory
. So if you create a formset class in a different way, the edit_only
attribute is not set and a crash happens in the save()
method when referring to if self.edit_only:
.
Change History (8)
comment:1 by , 2 years ago
Cc: | added |
---|---|
Easy pickings: | set |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 2 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 2 years ago
Cc: | added |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:4 by , 2 years ago
Has patch: | set |
---|---|
Needs tests: | set |
Triage Stage: | Ready for checkin → Accepted |
"Ready for checkin" is set by a patch reviewer, not the patch author (see Triaging tickets). Also, a regression test is required.
comment:5 by , 2 years ago
got it. thanks for the reference doc. updated the pr: https://github.com/django/django/pull/15818
comment:6 by , 2 years ago
Needs tests: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
Agreed, we should set:
Thanks for the report!