From 64cce8a048b68132c3580de9f1df000a2e8ef49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Thu, 30 Jan 2025 09:44:46 +0000 Subject: [PATCH] Fix currency API endpoint accepting only lowercase currency strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukáš Kucharczyk --- games/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/games/tasks.py b/games/tasks.py index 93558a7..18cc596 100644 --- a/games/tasks.py +++ b/games/tasks.py @@ -33,8 +33,9 @@ def convert_prices(): if not exchange_rate: try: + # this API endpoint only accepts lowercase currency string response = requests.get( - f"https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@{year}-01-01/v1/currencies/{currency_from}.json" + f"https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@{year}-01-01/v1/currencies/{currency_from.lower()}.json" ) response.raise_for_status() data = response.json()