Skip to content

Commit e9bef34

Browse files
committed
Minor UI fix to Manager Panel. This closes #9
1 parent 59b1fdf commit e9bef34

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

db.sqlite3

0 Bytes
Binary file not shown.

rental/views.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -186,20 +186,19 @@ def return_device(request):
186186
inventory.save()
187187

188188
#-----------intentionally left here
189-
# reservations = Rental.objects.filter(event = rental.event, reservation = True)
190-
# rentals = Rental.objects.filter(event = rental.event, reservation = False, returned = False)
191-
192-
# free_inventory = {}
193-
# for device in rental.event.devices.all():
194-
# free_inventory[device.name] = Inventory.objects.filter(event=rental.event, device=device, rented = False)
195-
196-
# context = {
197-
# 'reservations' : reservations,
198-
# 'rentals' : rentals,
199-
# 'free_inventories': free_inventory,
200-
# }
201-
# return render(request, 'partials/manager_partial.html', context)
202-
return HttpResponse('Returned!')
189+
reservations = Rental.objects.filter(event = rental.event, reservation = True)
190+
rentals = Rental.objects.filter(event = rental.event, reservation = False, returned = False)
191+
free_inventory = {}
192+
for device in rental.event.devices.all():
193+
free_inventory[device.name] = Inventory.objects.filter(event=rental.event, device=device, rented = False)
194+
195+
context = {
196+
'reservations' : reservations,
197+
'rentals' : rentals,
198+
'free_inventories': free_inventory,
199+
}
200+
return render(request, 'partials/manager_partial.html', context)
201+
#return HttpResponse('Returned!')
203202

204203

205204
@login_required

0 commit comments

Comments
 (0)