Browse files

Expressed the dirty flag handling logic in terms of autocommit.

  • Loading branch information...
1 parent cd364ef commit 7b4815b455fc99a2661492f91f7242cfb09a7017 @aaugustin aaugustin committed Mar 7, 2013
Showing with 2 additions and 5 deletions.
  1. +2 −1 django/db/backends/__init__.py
  2. +0 −4 django/db/backends/postgresql_psycopg2/base.py
View
3 django/db/backends/__init__.py
@@ -311,7 +311,8 @@ def set_dirty(self):
to decide in a managed block of code to decide whether there are open
changes waiting for commit.
"""
- self._dirty = True
+ if not self.autocommit:
+ self._dirty = True
def set_clean(self):
"""
View
4 django/db/backends/postgresql_psycopg2/base.py
@@ -202,10 +202,6 @@ def _set_autocommit(self, autocommit):
level = self.isolation_level
self.connection.set_isolation_level(level)
- def set_dirty(self):
- if self.transaction_state and self.transaction_state[-1]:
- super(DatabaseWrapper, self).set_dirty()
-
def check_constraints(self, table_names=None):
"""
To check constraints, we set constraints to immediate. Then, when, we're done we must ensure they

0 comments on commit 7b4815b

Please sign in to comment.