Opened 8 years ago

Closed 8 years ago

#5735 closed (fixed)

transaction for newforms-admin

Reported by: Honza_Kral 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: UI/UX:

Description

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_Kral 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Honza_Kral

comment:1 Changed 8 years ago by jkocherhans

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jkocherhans
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

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

comment:2 Changed 8 years ago by brosner

  • 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 8 years ago by brosner

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

(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