Fix exchange rate updates (#5843)

- Handle base currencies which are not USD
- API changed "base_currency" to "base"
This commit is contained in:
Oliver 2023-11-03 11:58:39 +11:00 committed by GitHub
parent 5d55555394
commit a7c0882c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,8 @@ class InvenTreeExchange(SimpleExchangeBackend):
rates = super().get_rates(**params)
# Add the base currency to the rates
rates[params["base_currency"]] = Decimal("1.0")
base_currency = params.get('base', currency_code_default())
rates[base_currency] = Decimal("1.0")
return rates