Commit 121188e2 authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

[1.1.X] Corrected an edge case introduced in r12602. Thanks to Ramiro Morales for the eagle eyes.

Backport of r12605 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12606 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 94054604
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -97,9 +97,11 @@ class DatabaseWrapper(BaseDatabaseWrapper):
        self.validation = BaseDatabaseValidation()

    def _cursor(self):
        new_connection = False
        set_tz = False
        settings_dict = self.settings_dict
        if self.connection is None:
            new_connection = True
            set_tz = settings_dict.get('TIME_ZONE')
            if settings_dict['DATABASE_NAME'] == '':
                from django.core.exceptions import ImproperlyConfigured
@@ -117,6 +119,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
            self.connection.set_isolation_level(1) # make transactions transparent to all cursors
            connection_created.send(sender=self.__class__)
        cursor = self.connection.cursor()
        if new_connection:
            if set_tz:
                cursor.execute("SET TIME ZONE %s", [settings_dict['TIME_ZONE']])
            if not hasattr(self, '_version'):
+5 −2
Original line number Diff line number Diff line
@@ -74,9 +74,11 @@ class DatabaseWrapper(BaseDatabaseWrapper):
        self.validation = BaseDatabaseValidation()

    def _cursor(self):
        new_connection = False
        set_tz = False
        settings_dict = self.settings_dict
        if self.connection is None:
            new_connection = True
            set_tz = settings_dict.get('TIME_ZONE')
            if settings_dict['DATABASE_NAME'] == '':
                from django.core.exceptions import ImproperlyConfigured
@@ -101,6 +103,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
            connection_created.send(sender=self.__class__)
        cursor = self.connection.cursor()
        cursor.tzinfo_factory = None
        if new_connection:
            if set_tz:
                cursor.execute("SET TIME ZONE %s", [settings_dict['TIME_ZONE']])
            if not hasattr(self, '_version'):