From 6b689a505c7a89d497e2e8af690fdf5a00780a2d Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 6 Feb 2016 09:21:05 -0500 Subject: [1.9.x] Fixed #26177 -- Fixed a PostgreSQL crash with TIME_ZONE=None and USE_TZ=False. Backport of 97eb3356b2a7488c8d0ca0e47ef3e538852d44a2 from master --- django/db/backends/postgresql/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db') diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index 383601e477..6a53648f74 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -196,7 +196,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]) -- cgit v1.3