Simplify DB object management with Django CRUD helpers
This commit is contained in:
@@ -92,12 +92,12 @@ class Account(models.Model):
|
||||
try:
|
||||
request = GetAssetsRequest(status="active", asset_class="crypto")
|
||||
assets = self.client.get_all_assets(filter=request)
|
||||
asset_list = [x["symbol"] for x in assets if "symbol" in x]
|
||||
self.supported_symbols = asset_list
|
||||
print("Supported symbols", self.supported_symbols)
|
||||
except APIError as e:
|
||||
log.error(f"Could not get asset list: {e}")
|
||||
return False
|
||||
asset_list = [x["symbol"] for x in assets if "symbol" in x]
|
||||
self.supported_symbols = asset_list
|
||||
print("Supported symbols", self.supported_symbols)
|
||||
# return False
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user