|
|
|
@ -7,11 +7,12 @@ from mixins.views import ( # ObjectRead,
|
|
|
|
|
)
|
|
|
|
|
from two_factor.views.mixins import OTPRequiredMixin
|
|
|
|
|
|
|
|
|
|
from core.clients.platforms.agora import AgoraClient
|
|
|
|
|
# from core.clients.platforms.agora import AgoraClient
|
|
|
|
|
from core.forms import PlatformForm
|
|
|
|
|
from core.models import Platform
|
|
|
|
|
from core.util import logs
|
|
|
|
|
from core.views.helpers import synchronize_async_helper
|
|
|
|
|
|
|
|
|
|
# from core.views.helpers import synchronize_async_helper
|
|
|
|
|
|
|
|
|
|
log = logs.get_logger(__name__)
|
|
|
|
|
|
|
|
|
@ -30,9 +31,10 @@ class PlatformTrades(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
|
|
|
|
platforms = Platform.get_for_user(self.request.user)
|
|
|
|
|
total_trades = {}
|
|
|
|
|
for platform in platforms:
|
|
|
|
|
run = synchronize_async_helper(AgoraClient(platform))
|
|
|
|
|
dash = synchronize_async_helper(run.wrap_dashboard())
|
|
|
|
|
total_trades[platform.name] = dash
|
|
|
|
|
# run = synchronize_async_helper(AgoraClient(platform))
|
|
|
|
|
# dash = synchronize_async_helper(run.wrap_dashboard())
|
|
|
|
|
trades = platform.trades
|
|
|
|
|
total_trades[platform.name] = trades
|
|
|
|
|
|
|
|
|
|
return total_trades
|
|
|
|
|
|
|
|
|
|