Opened 9 years ago

Closed 9 years ago

#5758 closed (fixed)

[newforms-admin] save() fails for non-deletable formsets

Reported by: Antti Kaihola Owned by: nobody
Component: Forms Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If deletable=True is not specified for a formset, trying to save it results in a KeyError with value 'DELETE' on line 272 of django/newforms/models.py.

Attachments (2)

5758_fix.diff (665 bytes) - added by Brian Rosner 9 years ago.
non-deletable-formset-save.diff (684 bytes) - added by Antti Kaihola 9 years ago.
wouldn't testing for deletability implement the design more accurately?

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by Brian Rosner

Attachment: 5758_fix.diff added

comment:1 Changed 9 years ago by Brian Rosner

Has patch: set
Triage Stage: UnreviewedAccepted

I have attached a patch that uses .get as opposed to directly pulling from the cleaned_data dict.

Changed 9 years ago by Antti Kaihola

wouldn't testing for deletability implement the design more accurately?

comment:2 Changed 9 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [6654]) newforms-admin: Fixed #5758 -- Added a check to ensure that an inline model formset is actually deletable before checking the deletion field. Thanks, Brian Rosner and akaihola.

Note: See TracTickets for help on using tickets.
Back to Top