feat: Increase number of supported currency exchanges

Switch from frankfurter.app to exchangerate.host to accomodate more currency usage.
Closes #25603
This commit is contained in:
Dany Robert
2021-05-15 12:23:05 +05:30
committed by GitHub
parent 2ded94c338
commit aea8773503

View File

@@ -98,10 +98,10 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No
if not value:
import requests
api_url = "https://frankfurter.app/{0}".format(transaction_date)
api_url = "https://api.exchangerate.host/latest"
response = requests.get(api_url, params={
"base": from_currency,
"symbols": to_currency
"symbols": from_currency+","+to_currency,
"base": from_currency
})
# expire in 6 hours
response.raise_for_status()