Django

Code

Ticket #5735 (closed: fixed)

Opened 11 months ago

Last modified 6 months ago

transaction for newforms-admin

Reported by: Honza_Kral Assigned to: jkocherhans
Milestone: Component: Uncategorized
Version: newforms-admin Keywords: nfa-blocker admin transaction
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

5735against6470.patch (1.5 kB) - added by Honza_Kral on 10/11/07 06:02:19.

Change History

10/11/07 06:02:19 changed by Honza_Kral

  • attachment 5735against6470.patch added.

12/01/07 11:13:30 changed by jkocherhans

  • status changed from new to assigned.
  • needs_better_patch changed.
  • needs_tests changed.
  • owner changed from nobody to jkocherhans.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.

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

12/10/07 10:44:10 changed by brosner

  • keywords changed from admin transaction to nfa-blocker admin transaction.

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.

02/29/08 15:42:20 changed by brosner

  • status changed from assigned to closed.
  • resolution set to fixed.

(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...


Add/Change #5735 (transaction for newforms-admin)




Change Properties
Action