From f288107c87006ba609d2031bf13a1d0a39e517c6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 18:08:19 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- api_dados_rio/custom/views.py | 6 +++--- api_dados_rio/v2/adm_cor_comando/views.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api_dados_rio/custom/views.py b/api_dados_rio/custom/views.py index c6dd7e5..6c96c43 100644 --- a/api_dados_rio/custom/views.py +++ b/api_dados_rio/custom/views.py @@ -53,9 +53,9 @@ def get(request, format=None): pattern = str(urlpatterns.pattern).rstrip("/") if self.ignore_admin and pattern == "admin": continue - data[ - str(urlpatterns.pattern).rstrip("/") - ] = f"{current_url}/{str(urlpatterns.pattern)}" + data[str(urlpatterns.pattern).rstrip("/")] = ( + f"{current_url}/{str(urlpatterns.pattern)}" + ) elif isinstance(urlpatterns, URLPattern): # Parse the URLPattern to something readable base_pattern = str(urlpatterns.pattern).rstrip("$") diff --git a/api_dados_rio/v2/adm_cor_comando/views.py b/api_dados_rio/v2/adm_cor_comando/views.py index 11b2832..3fc0588 100644 --- a/api_dados_rio/v2/adm_cor_comando/views.py +++ b/api_dados_rio/v2/adm_cor_comando/views.py @@ -155,9 +155,9 @@ def list(self, request): if "error" in result and result["error"]: if key_backup in cache: result = cache.get(key_backup) - result[ - "error" - ] = "Failed to fetch new data, using backup cached data." + result["error"] = ( + "Failed to fetch new data, using backup cached data." + ) return Response(result, status=200) return Response( { @@ -177,9 +177,9 @@ def list(self, request): if key_backup in cache: result = cache.get(key_backup) last_update = cache.get(key_backup_last_updated) - result[ - "error" - ] = f"Failed to fetch new data, using backup cached data from {last_update}." + result["error"] = ( + f"Failed to fetch new data, using backup cached data from {last_update}." + ) return Response(result, status=200) return Response( {"error": "Something went wrong. Try again later."},