Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #7286 -- Added functools wrapping to the transaction decorators…

…. Thanks, SmileyChris.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7558 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8a0b8d93b2aa88c0d5bd70a2637ebb05c04fcca8 1 parent 55d5f7e
@freakboy3742 freakboy3742 authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 django/db/transaction.py
View
10 django/db/transaction.py
@@ -16,6 +16,10 @@
import thread
except ImportError:
import dummy_thread as thread
+try:
+ from functools import wraps
+except ImportError:
+ from django.utils.functional import wraps # Python 2.3, 2.4 fallback.
from django.db import connection
from django.conf import settings
@@ -177,7 +181,7 @@ def _autocommit(*args, **kw):
return func(*args, **kw)
finally:
leave_transaction_management()
- return _autocommit
+ return wraps(func)(_autocommit)
def commit_on_success(func):
"""
@@ -202,7 +206,7 @@ def _commit_on_success(*args, **kw):
return res
finally:
leave_transaction_management()
- return _commit_on_success
+ return wraps(func)(_commit_on_success)
def commit_manually(func):
"""
@@ -219,4 +223,4 @@ def _commit_manually(*args, **kw):
finally:
leave_transaction_management()
- return _commit_manually
+ return wraps(func)(_commit_manually)
Please sign in to comment.
Something went wrong with that request. Please try again.