Ticket #7286: transaction-decorators-wraps.diff
File transaction-decorators-wraps.diff, 1.1 KB (added by , 16 years ago) |
---|
-
django/db/transaction.py
16 16 import thread 17 17 except ImportError: 18 18 import dummy_thread as thread 19 try: 20 from functools import wraps 21 except ImportError: 22 from django.utils.functional import wraps # Python 2.3, 2.4 fallback. 23 19 24 from django.db import connection 20 25 from django.conf import settings 21 26 … … 177 182 return func(*args, **kw) 178 183 finally: 179 184 leave_transaction_management() 180 return _autocommit185 return wraps(func)(_autocommit) 181 186 182 187 def commit_on_success(func): 183 188 """ … … 202 207 return res 203 208 finally: 204 209 leave_transaction_management() 205 return _commit_on_success210 return wraps(func)(_commit_on_success) 206 211 207 212 def commit_manually(func): 208 213 """ … … 219 224 finally: 220 225 leave_transaction_management() 221 226 222 return _commit_manually227 return wraps(func)(_commit_manually)