Add backend for exchangerate.host

This commit is contained in:
Oliver Walters 2021-05-23 21:14:43 +10:00
parent 098b9b7597
commit 65aa468168

View File

@ -1,4 +1,4 @@
from djmoney.contrib.exchange.backends.base import BaseExchangeBackend
from djmoney.contrib.exchange.backends.base import BaseExchangeBackend, SimpleExchangeBackend
class InvenTreeManualExchangeBackend(BaseExchangeBackend):
@ -19,3 +19,18 @@ class InvenTreeManualExchangeBackend(BaseExchangeBackend):
"""
return {}
class ExchangeRateHostBackend(SimpleExchangeBackend):
"""
Backend for https://exchangerate.host/
"""
name = "exchangerate.host"
def __init__(self):
self.url = "https://api.exchangerate.host/latest"
def get_params(self):
# No API key is required
return {}