mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
safer check if fixer-backend is used
This commit is contained in:
parent
4503f23ae4
commit
b1b974a1f6
@ -959,7 +959,7 @@ class CurrencySettingsView(FormView):
|
||||
stored_rates = exchange_rate_backend.get_stored_rates()
|
||||
|
||||
for field in form.fields:
|
||||
if 'fixer' in exchange_rate_backend.name:
|
||||
if exchange_rate_backend.name.startswith('fixer-'):
|
||||
# Disable all the fields
|
||||
form.fields[field].disabled = True
|
||||
form.fields[field].initial = clean_decimal(stored_rates.get(field, 0))
|
||||
@ -973,7 +973,7 @@ class CurrencySettingsView(FormView):
|
||||
# Get exchange rate backend
|
||||
exchange_rate_backend = self.get_exchange_rate_backend()
|
||||
|
||||
if 'fixer' in exchange_rate_backend.name:
|
||||
if exchange_rate_backend.name.startswith('fixer-'):
|
||||
# Refresh rate from Fixer.IO API
|
||||
exchange_rate_backend.update_rates(base_currency=exchange_rate_backend.base_currency)
|
||||
# Check if rates have been updated
|
||||
|
Loading…
Reference in New Issue
Block a user