Fix currency API endpoint accepting only lowercase currency strings
Signed-off-by: Lukáš Kucharczyk <lukas@kucharczyk.xyz>
This commit is contained in:
parent
2116cfc219
commit
64cce8a048
@ -33,8 +33,9 @@ def convert_prices():
|
|||||||
|
|
||||||
if not exchange_rate:
|
if not exchange_rate:
|
||||||
try:
|
try:
|
||||||
|
# this API endpoint only accepts lowercase currency string
|
||||||
response = requests.get(
|
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()
|
response.raise_for_status()
|
||||||
data = response.json()
|
data = response.json()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user