mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1605 from SchrodingersGat/exchange-rates
Add backend for exchangerate.host
This commit is contained in:
commit
2d61e6fc5d
@ -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 {}
|
||||
|
Loading…
Reference in New Issue
Block a user