diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-03-12 14:10:01 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-03-12 14:10:01 +0000 |
| commit | ef0be292a687f95f1081b2ff8170fd7cbd5a365f (patch) | |
| tree | 6d731bf5ca7c5eeec5821125a3af3310044cff64 /django/db/transaction.py | |
| parent | 615eab6b0255608e2094f0ecf02c5351a1e887cc (diff) | |
Fixed #11900 -- Corrected an edge case of transaction handling in the commit_on_success decorator. Thanks to guettli for the report, and Gabriel Hurley for the initial test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12764 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/transaction.py')
| -rw-r--r-- | django/db/transaction.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/transaction.py b/django/db/transaction.py index 6cd078d94d..31d717f4d2 100644 --- a/django/db/transaction.py +++ b/django/db/transaction.py @@ -304,7 +304,11 @@ def commit_on_success(using=None): raise else: if is_dirty(using=db): - commit(using=db) + try: + commit(using=db) + except: + rollback(using=db) + raise return res finally: leave_transaction_management(using=db) |
