diff options
author | django-bot <ops@djangoproject.com> | 2022-02-03 20:24:19 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-07 20:37:05 +0100 |
commit | 9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch) | |
tree | f0506b668a013d0063e5fba3dbf4863b466713ba /django/contrib/postgres/signals.py | |
parent | f68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff) | |
download | django-9c19aff7c7561e3a82978a272ecdaad40dda5c00.tar.gz |
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'django/contrib/postgres/signals.py')
-rw-r--r-- | django/contrib/postgres/signals.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/django/contrib/postgres/signals.py b/django/contrib/postgres/signals.py index 420b5f6033..b61673fe1f 100644 --- a/django/contrib/postgres/signals.py +++ b/django/contrib/postgres/signals.py @@ -35,12 +35,14 @@ def get_citext_oids(connection_alias): def register_type_handlers(connection, **kwargs): - if connection.vendor != 'postgresql' or connection.alias == NO_DB_ALIAS: + if connection.vendor != "postgresql" or connection.alias == NO_DB_ALIAS: return try: oids, array_oids = get_hstore_oids(connection.alias) - register_hstore(connection.connection, globally=True, oid=oids, array_oid=array_oids) + register_hstore( + connection.connection, globally=True, oid=oids, array_oid=array_oids + ) except ProgrammingError: # Hstore is not available on the database. # @@ -54,7 +56,9 @@ def register_type_handlers(connection, **kwargs): try: citext_oids = get_citext_oids(connection.alias) - array_type = psycopg2.extensions.new_array_type(citext_oids, 'citext[]', psycopg2.STRING) + array_type = psycopg2.extensions.new_array_type( + citext_oids, "citext[]", psycopg2.STRING + ) psycopg2.extensions.register_type(array_type, None) except ProgrammingError: # citext is not available on the database. |