ws for transfers
This commit is contained in:
parent
1ea334341b
commit
1d5e693045
1 changed files with 23 additions and 0 deletions
|
@ -1603,6 +1603,29 @@ def perform_transfers(request):
|
|||
transfer.save()
|
||||
data['transfers'].append(transfer.pk)
|
||||
|
||||
# Websocket data
|
||||
websocket_data = {}
|
||||
websocket_data['opegroups'] = [{
|
||||
'add': True,
|
||||
'type': 'transfergroup',
|
||||
'id': transfergroup.pk,
|
||||
'at': transfergroup.at,
|
||||
'comment': transfergroup.comment,
|
||||
'valid_by__trigramme': ( transfergroup.valid_by and
|
||||
transfergroup.valid_by.trigramme or None),
|
||||
'opes': [],
|
||||
}]
|
||||
for transfer in transfers:
|
||||
ope_data = {
|
||||
'id': transfer.pk,
|
||||
'amount': transfer.amount,
|
||||
'from_acc': transfer.from_acc.trigramme,
|
||||
'to_acc': transfer.to_acc.trigramme,
|
||||
'canceled_by__trigramme': None, 'canceled_at': None,
|
||||
}
|
||||
websocket_data['opegroups'][0]['opes'].append(ope_data)
|
||||
|
||||
consumers.KPsul.group_send('kfet.kpsul', websocket_data)
|
||||
return JsonResponse(data)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue