mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Prevent creation of duplicate backend objects
This commit is contained in:
parent
44b42050aa
commit
0b6d1ce86f
@ -250,13 +250,12 @@ def update_exchange_rates():
|
||||
try:
|
||||
backend = ExchangeBackend.objects.get(name='InvenTreeExchange')
|
||||
except ExchangeBackend.DoesNotExist:
|
||||
pass
|
||||
backend = InvenTreeExchange()
|
||||
except Exception: # pragma: no cover
|
||||
# Some other error
|
||||
logger.warning("update_exchange_rates: Database not ready")
|
||||
return
|
||||
|
||||
backend = InvenTreeExchange()
|
||||
logger.info(f"Updating exchange rates from {backend.url}")
|
||||
|
||||
base = currency_code_default()
|
||||
|
Loading…
Reference in New Issue
Block a user