Opened 5 years ago

Last modified 5 years ago

#28159 closed Bug

Fix issues with InlineFormset.save_as_new in Django 1.11 — at Initial Version

Reported by: Alexander Kavanaugh Owned by: nobody
Component: Forms Version: 1.11
Severity: Release blocker Keywords: inlineformset, save_as_new
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Django 1.11 now marks multipart POST data as immutable [(Release notes section)]( This causes an issue with the private save_as_new feature in InlineFormsets: the set code in the conditional block [here]( now throws an AttributeError because the data it's attempting to change is marked as immutable.

To restore previous behavior, this pull request turns off the immutability flag on the form data while the save_as_new functionality runs and turns immutability back on when the mutation code is complete.

Note that the mutable flag isn't set if there is no data, hence the hasattr code.


Change History (0)

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