mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
Fixed #34486 -- Fixed DatabaseOperations.compose_sql() crash with no existing database connection on PostgreSQL.
Regression in 09ffc5c121.
This commit is contained in:
committed by
Mariusz Felisiak
parent
813015d67e
commit
53aee470d5
@@ -18,7 +18,8 @@ try:
|
||||
TSTZRANGE_OID = types["tstzrange"].oid
|
||||
|
||||
def mogrify(sql, params, connection):
|
||||
return ClientCursor(connection.connection).mogrify(sql, params)
|
||||
with connection.cursor() as cursor:
|
||||
return ClientCursor(cursor.connection).mogrify(sql, params)
|
||||
|
||||
# Adapters.
|
||||
class BaseTzLoader(TimestamptzLoader):
|
||||
|
||||
Reference in New Issue
Block a user