updated modal code

This commit is contained in:
Alexander Werner
2017-03-06 20:05:53 +01:00
parent 51a5d1659a
commit e7a25888a7
3 changed files with 14 additions and 11 deletions

View File

@@ -32,12 +32,19 @@ class LocationDataDetailView(DetailView):
@login_required
def accountmodalview(request):
accounts = Accounting.objects.filter(reporter_uuid=Client.objects.get(report_user=request.user).uuid)
account = Accounting.objects.filter(reporter_uuid=Client.objects.get(report_user=request.user).uuid).first
context = {
'accounts': accounts
'account': account
}
return render(request, 'billard/accountmodal.html', context=context)
@login_required
def accountmodalconfirmview(request, pk):
account = Accounting.objects.get(pk=pk)
account.reporter_uuid = None
account.save()
redirect('carom_index')
@login_required
def index(request):
if request.method == 'GET':
@@ -61,13 +68,11 @@ def index(request):
loc = min_loc
locations = Location.objects.filter(users__id=request.user.id).order_by('code')
clients = Client.objects.filter(location_id=loc).order_by('id')
accounts = Accounting.objects.filter(reporter_uuid=Client.objects.get(report_user=request.user).uuid)
context = {
'range': range(1, 9),
'locations': locations,
'clients': clients,
'location_id': int(loc),
'accounts': accounts,
}
return render(request, template, context=context)
if request.method == 'POST':