Loading django/db/backends/postgresql_psycopg2/base.py +1 −1 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): tz = self.settings_dict['TIME_ZONE'] conn_tz = self.connection.get_parameter_status('TimeZone') if conn_tz != tz: if tz and conn_tz != tz: cursor = self.connection.cursor() try: cursor.execute(self.ops.set_time_zone_sql(), [tz]) Loading django/test/signals.py +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ def update_connections_time_zone(**kwargs): for conn in connections.all(): conn.settings_dict['TIME_ZONE'] = tz tz_sql = conn.ops.set_time_zone_sql() if tz_sql: if tz_sql and tz: conn.cursor().execute(tz_sql, [tz]) Loading docs/releases/1.8.10.txt +2 −1 Original line number Diff line number Diff line Loading @@ -9,4 +9,5 @@ Django 1.8.10 fixes several bugs in 1.8.9. Bugfixes ======== * ... * Fixed a crash on PostgreSQL that prevented using ``TIME_ZONE=None`` and ``USE_TZ=False`` (:ticket:`26177`). tests/backends/tests.py +5 −0 Original line number Diff line number Diff line Loading @@ -804,6 +804,11 @@ class BackendTestCase(TransactionTestCase): BaseDatabaseWrapper.queries_limit = old_queries_limit new_connection.close() def test_timezone_none_use_tz_false(self): connection.ensure_connection() with self.settings(TIME_ZONE=None, USE_TZ=False): connection.init_connection_state() # We don't make these tests conditional because that means we would need to # check and differentiate between: Loading Loading
django/db/backends/postgresql_psycopg2/base.py +1 −1 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): tz = self.settings_dict['TIME_ZONE'] conn_tz = self.connection.get_parameter_status('TimeZone') if conn_tz != tz: if tz and conn_tz != tz: cursor = self.connection.cursor() try: cursor.execute(self.ops.set_time_zone_sql(), [tz]) Loading
django/test/signals.py +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ def update_connections_time_zone(**kwargs): for conn in connections.all(): conn.settings_dict['TIME_ZONE'] = tz tz_sql = conn.ops.set_time_zone_sql() if tz_sql: if tz_sql and tz: conn.cursor().execute(tz_sql, [tz]) Loading
docs/releases/1.8.10.txt +2 −1 Original line number Diff line number Diff line Loading @@ -9,4 +9,5 @@ Django 1.8.10 fixes several bugs in 1.8.9. Bugfixes ======== * ... * Fixed a crash on PostgreSQL that prevented using ``TIME_ZONE=None`` and ``USE_TZ=False`` (:ticket:`26177`).
tests/backends/tests.py +5 −0 Original line number Diff line number Diff line Loading @@ -804,6 +804,11 @@ class BackendTestCase(TransactionTestCase): BaseDatabaseWrapper.queries_limit = old_queries_limit new_connection.close() def test_timezone_none_use_tz_false(self): connection.ensure_connection() with self.settings(TIME_ZONE=None, USE_TZ=False): connection.init_connection_state() # We don't make these tests conditional because that means we would need to # check and differentiate between: Loading