Opened 7 years ago

Closed 7 years ago

#5758 closed (fixed)

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

Reported by: akaihola 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 brosner 7 years ago.
non-deletable-formset-save.diff (684 bytes) - added by akaihola 7 years ago.
wouldn't testing for deletability implement the design more accurately?

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by brosner

comment:1 Changed 7 years ago by brosner

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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

Changed 7 years ago by akaihola

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

comment:2 Changed 7 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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