Documented the market system properly, squashed some bugs
This commit is contained in:
@@ -86,10 +86,7 @@ class Account(models.Model):
|
||||
name += " (sandbox)"
|
||||
return name
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""
|
||||
Override the save function to update supported symbols.
|
||||
"""
|
||||
def update_info(self, save=True):
|
||||
client = self.get_client()
|
||||
if client:
|
||||
response = client.get_instruments()
|
||||
@@ -99,6 +96,14 @@ class Account(models.Model):
|
||||
self.supported_symbols = supported_symbols
|
||||
self.instruments = response
|
||||
self.currency = currency
|
||||
if save:
|
||||
self.save()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""
|
||||
Override the save function to update supported symbols.
|
||||
"""
|
||||
self.update_info(save=False)
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def get_client(self):
|
||||
|
||||
Reference in New Issue
Block a user