From f7d1ac0c240fad1edcc61f4dffc7534db6831e24 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 08:31:02 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- django_redis/pool.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/django_redis/pool.py b/django_redis/pool.py index 20817992..402d8797 100644 --- a/django_redis/pool.py +++ b/django_redis/pool.py @@ -1,5 +1,5 @@ from typing import Dict -from urllib.parse import parse_qs, urlparse,urlencode,urlunparse +from urllib.parse import parse_qs, urlencode, urlparse, urlunparse from django.conf import settings from django.core.exceptions import ImproperlyConfigured @@ -168,23 +168,20 @@ def get_connection_pool(self, params): query_params = parse_qs(url.query) is_master = query_params.get("is_master") if is_master: - cp_params['is_master'] = to_bool(is_master[0]) + cp_params["is_master"] = to_bool(is_master[0]) # then remove the "is_master" query string from the URL # so it doesn't interfere with the SentinelConnectionPool constructor - if 'is_master' in query_params: - del query_params['is_master'] + if "is_master" in query_params: + del query_params["is_master"] new_query = urlencode(query_params, doseq=True) - new_url = urlunparse(( - url.scheme, - url.netloc, - url.path, - url.params, - new_query, - url.fragment - )) + new_url = urlunparse( + (url.scheme, url.netloc, url.path, url.params, new_query, url.fragment) + ) - cp_params.update(service_name=url.hostname, sentinel_manager=self._sentinel,url=new_url) + cp_params.update( + service_name=url.hostname, sentinel_manager=self._sentinel, url=new_url + ) pool = super().get_connection_pool(cp_params) return pool