Opened 13 years ago

Closed 13 years ago

#5735 closed (fixed)

transaction for newforms-admin

Reported by: Honza Král Owned by: jkocherhans
Component: Uncategorized Version: newforms-admin
Severity: Keywords: nfa-blocker admin transaction
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When I try and save some object in admin that has some edit_inline and some error occurs while saving those, the DB is inconsistent - the main object exists, as well as some of the inline objects, but not all of them. Would it break anything to wrap save_change and save_add in django.db.transaction.commit_on_success?

Attachments (1)

5735against6470.patch (1.5 KB) - added by Honza Král 13 years ago.

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by Honza Král

Attachment: 5735against6470.patch added

comment:1 Changed 13 years ago by jkocherhans

Owner: changed from nobody to jkocherhans
Status: newassigned
Triage Stage: UnreviewedAccepted

Jacob and I discussed this IRL, and he thinks this looks like the right solution.

comment:2 Changed 13 years ago by Brian Rosner

Keywords: nfa-blocker added

I think that this should be included before a merge to trunk. I am tagging with nfa-blocker to get this patch ready for inclusion soon.

comment:3 Changed 13 years ago by Brian Rosner

Resolution: fixed
Status: assignedclosed

(In [7188]) newforms-admin: Fixed #5735. Wrapped save_add and save_change with commit_on_success to ensure data consistency if an inline fails to save. Thanks, Honza Kral.

Hrm, this didn't seem to work with the commit hook...

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