filter transfers frop opes

This commit is contained in:
Ludovic Stephan 2016-12-11 14:45:52 -02:00
parent 2c2da60e54
commit 49bef61e53

View file

@ -1102,7 +1102,9 @@ def kpsul_cancel_operations(request):
# Checking if BAD REQUEST (opes_pk not int or not existing)
try:
# Set pour virer les doublons
opes_post = set(map(int, filter(None, request.POST.getlist('operations[]', []))))
opes_post = set(map(lambda s: int(s.split()[1]),
filter(lambda s: s.split()[0] == 'ope',
request.POST.getlist('operations[]', []))))
except ValueError:
return JsonResponse(data, status=400)
opes_all = (