Fixed #26177 -- Fixed a PostgreSQL crash with TIME_ZONE=None and USE_TZ=False.

This commit is contained in:
Tim Graham 2016-02-06 09:21:05 -05:00
parent e000ca23d2
commit 97eb3356b2
5 changed files with 12 additions and 3 deletions

View file

@ -197,7 +197,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
conn_timezone_name = self.connection.get_parameter_status('TimeZone')
if conn_timezone_name != self.timezone_name:
if self.timezone_name and conn_timezone_name != self.timezone_name:
cursor = self.connection.cursor()
try:
cursor.execute(self.ops.set_time_zone_sql(), [self.timezone_name])