Ticket #15802: 15802-2.diff
File 15802-2.diff, 1.4 KB (added by , 13 years ago) |
---|
-
django/db/backends/postgresql_psycopg2/base.py
146 146 new_connection = False 147 147 set_tz = False 148 148 settings_dict = self.settings_dict 149 if self.connection is not None: 150 try: 151 cursor = self.connection.cursor() 152 except Database.Error: 153 # It seems we lost our connection without getting a notification. 154 # Make sure the connection is really closed and connection is set 155 # to None. The code below will then create a new connection. See 156 # also the above comment in close(). 157 try: 158 self.close() 159 except Database.Error: 160 pass 149 161 if self.connection is None: 150 162 new_connection = True 151 163 set_tz = settings_dict.get('TIME_ZONE') … … 170 182 self.connection.set_client_encoding('UTF8') 171 183 self.connection.set_isolation_level(self.isolation_level) 172 184 connection_created.send(sender=self.__class__, connection=self) 173 cursor = self.connection.cursor()185 cursor = self.connection.cursor() 174 186 cursor.tzinfo_factory = None 175 187 if new_connection: 176 188 if set_tz: