Made transaction management work even before the first SQL query.

Thanks Florian again.
This commit is contained in:
Aymeric Augustin 2013-03-05 22:30:55 +01:00
parent 7c46c8d5f2
commit 09ba70f9f1
1 changed files with 4 additions and 0 deletions

View File

@ -269,6 +269,8 @@ class BaseDatabaseWrapper(object):
"""
self.validate_no_atomic_block()
self.ensure_connection()
self.transaction_state.append(managed)
if not managed and self.is_dirty() and not forced:
@ -286,6 +288,8 @@ class BaseDatabaseWrapper(object):
"""
self.validate_no_atomic_block()
self.ensure_connection()
if self.transaction_state:
del self.transaction_state[-1]
else: