Simplify schema and error handling

This commit is contained in:
2022-11-04 07:20:55 +00:00
parent 04a87c1da6
commit b36791d56b
8 changed files with 181 additions and 128 deletions

View File

@@ -5,7 +5,6 @@ from django.db import models
from core.exchanges.alpaca import AlpacaExchange
from core.exchanges.oanda import OANDAExchange
from core.lib import trades
from core.lib.customers import get_or_create, update_customer_fields
from core.util import logs
@@ -100,7 +99,7 @@ class Account(models.Model):
if self.exchange in EXCHANGE_MAP:
return EXCHANGE_MAP[self.exchange](self)
else:
raise Exception("Exchange not supported")
raise Exception(f"Exchange not supported : {self.exchange}")
@property
def client(self):