perf: 单独推送账号

This commit is contained in:
feng
2023-04-14 15:34:56 +08:00
committed by Jiangjie.Bai
parent 976daaa726
commit 31653cab11
2 changed files with 7 additions and 2 deletions

View File

@@ -24,10 +24,11 @@ class AccountsTaskCreateAPI(CreateAPIView):
def perform_create(self, serializer):
data = serializer.validated_data
accounts = data.get('accounts', [])
params = data.get('params')
account_ids = [str(a.id) for a in accounts]
if data['action'] == 'push':
task = push_accounts_to_assets_task.delay(account_ids)
task = push_accounts_to_assets_task.delay(account_ids, params)
else:
account = accounts[0]
asset = account.asset