From db7bb3b64e469fbb5c79e7b5b2fcb890434aa60f Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Mon, 12 Dec 2022 09:54:49 +0100 Subject: Refs #33308 -- Added DatabaseOperations.compose_sql() on PostgreSQL. --- django/contrib/postgres/search.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'django/contrib/postgres') diff --git a/django/contrib/postgres/search.py b/django/contrib/postgres/search.py index 2b57156263..05c8f72f6f 100644 --- a/django/contrib/postgres/search.py +++ b/django/contrib/postgres/search.py @@ -1,5 +1,3 @@ -import psycopg2 - from django.db.models import ( CharField, Expression, @@ -309,14 +307,9 @@ class SearchHeadline(Func): options_sql = "" options_params = [] if self.options: - # getquoted() returns a quoted bytestring of the adapted value. options_params.append( ", ".join( - "%s=%s" - % ( - option, - psycopg2.extensions.adapt(value).getquoted().decode(), - ) + connection.ops.compose_sql(f"{option}=%s", [value]) for option, value in self.options.items() ) ) -- cgit v1.3