Ticket #16250: 16250-1.diff

File 16250-1.diff, 1.4 KB (added by Ramiro Morales, 13 years ago)

Simple fix

  • django/db/backends/creation.py

    diff -r 7d5687126d6d django/db/backends/creation.py
    a b  
    247247            verbosity=max(verbosity - 1, 0),
    248248            interactive=False,
    249249            database=self.connection.alias)
    250        
     250
    251251        # One effect of calling syncdb followed by flush is that the id of the
    252252        # default site may or may not be 1, depending on how the sequence was
    253253        # reset.  If the sites app is loaded, then we coerce it.
     
    351351                self.connection.connection.autocommit(True)
    352352            else:
    353353                self.connection.connection.autocommit = True
    354         elif hasattr(self.connection.connection, "set_isolation_level"):
    355             self.connection.connection.set_isolation_level(0)
    356354
    357355    def sql_table_creation_suffix(self):
    358356        "SQL to append to the end of the test table creation statements"
  • django/db/backends/postgresql_psycopg2/creation.py

    diff -r 7d5687126d6d django/db/backends/postgresql_psycopg2/creation.py
    a b  
    7676        else:
    7777            output = []
    7878        return output
     79
     80    def set_autocommit(self):
     81        self.connection.connection.set_isolation_level(0)
Back to Top