update accounting

This commit is contained in:
Robert Einsle 2017-03-11 20:48:59 +01:00
parent ab6d1fa07e
commit 522411ea34

View File

@ -83,7 +83,7 @@ def accounting(request):
'location_id': int(loc),
'locations': locations,
'accounting': acc,
'acc_ids': acc_ids,
'acc_ids': ','.join(str(e) for e in acc_ids),
}
if acc_sum['prize__sum'] is None:
context['acc_sum'] = 0
@ -92,6 +92,9 @@ def accounting(request):
return render(request, template_name=template, context=context)
if request.method == 'POST':
loc = request.POST['location-selector']
if 'accountings' in request.POST:
acc_ids = request.POST['accountings'].split(',')
Accounting.objects.filter(id__in=acc_ids).update(billed=True)
request.session['loc'] = str(loc)
resp = redirect('accounting')
resp['Location'] += '?loc={}'.format(str(loc))