Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Expressed the dirty flag handling logic in terms of autocommit.

  • Loading branch information...
commit 7b4815b455fc99a2661492f91f7242cfb09a7017 1 parent cd364ef
Aymeric Augustin authored March 07, 2013
3  django/db/backends/__init__.py
@@ -311,7 +311,8 @@ def set_dirty(self):
311 311
         to decide in a managed block of code to decide whether there are open
312 312
         changes waiting for commit.
313 313
         """
314  
-        self._dirty = True
  314
+        if not self.autocommit:
  315
+            self._dirty = True
315 316
 
316 317
     def set_clean(self):
317 318
         """
4  django/db/backends/postgresql_psycopg2/base.py
@@ -202,10 +202,6 @@ def _set_autocommit(self, autocommit):
202 202
                 level = self.isolation_level
203 203
             self.connection.set_isolation_level(level)
204 204
 
205  
-    def set_dirty(self):
206  
-        if self.transaction_state and self.transaction_state[-1]:
207  
-            super(DatabaseWrapper, self).set_dirty()
208  
-
209 205
     def check_constraints(self, table_names=None):
210 206
         """
211 207
         To check constraints, we set constraints to immediate. Then, when, we're done we must ensure they

0 notes on commit 7b4815b

Please sign in to comment.
Something went wrong with that request. Please try again.