mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-07 10:51:17 +00:00
Prevent creation of duplicate backend objects
This commit is contained in:
1 parent
44b42050aa
commit
0b6d1ce86f
1 file changed
+1
-2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user