|
|
@ -18,7 +18,6 @@ def get_positions(user, account_id=None):
|
|
|
|
accounts = Account.objects.filter(user=user)
|
|
|
|
accounts = Account.objects.filter(user=user)
|
|
|
|
for account in accounts:
|
|
|
|
for account in accounts:
|
|
|
|
positions = account.client.get_all_positions()
|
|
|
|
positions = account.client.get_all_positions()
|
|
|
|
print("POSITIONS", positions)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for item in positions:
|
|
|
|
for item in positions:
|
|
|
|
item = dict(item)
|
|
|
|
item = dict(item)
|
|
|
@ -79,7 +78,6 @@ class PositionAction(LoginRequiredMixin, View):
|
|
|
|
|
|
|
|
|
|
|
|
account = Account.get_by_id(account_id, request.user)
|
|
|
|
account = Account.get_by_id(account_id, request.user)
|
|
|
|
success, info = trades.get_position_info(account, asset_id)
|
|
|
|
success, info = trades.get_position_info(account, asset_id)
|
|
|
|
print("INFO", info)
|
|
|
|
|
|
|
|
if not success:
|
|
|
|
if not success:
|
|
|
|
message = "Position does not exist"
|
|
|
|
message = "Position does not exist"
|
|
|
|
message_class = "danger"
|
|
|
|
message_class = "danger"
|
|
|
|