Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 17, 2024
1 parent 64c8e69 commit 631d8fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions api_dados_rio/custom/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("$")
Expand Down
12 changes: 6 additions & 6 deletions api_dados_rio/v2/adm_cor_comando/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand All @@ -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."},
Expand Down

0 comments on commit 631d8fc

Please sign in to comment.