1
0
mirror of https://github.com/django/django.git synced 2025-04-08 07:26:41 +00:00

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

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: