updated modal code
This commit is contained in:
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user