From 8f82b787420a65cb08b42b59dea1929c76b77be4 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 3 Nov 2010 14:04:10 +0100 Subject: [PATCH] tickets: Show number of payed tickets instead of reservations. The table header already said "payed tickets", but the number reflected the number of payed reservations, which isn't quite as useful. --- tickets/templates/tickets/bookings.html | 2 +- tickets/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tickets/templates/tickets/bookings.html b/tickets/templates/tickets/bookings.html index 0c0348d..787067b 100644 --- a/tickets/templates/tickets/bookings.html +++ b/tickets/templates/tickets/bookings.html @@ -8,7 +8,7 @@ {% for show, info in shows %} -{{ show }}{{ info.bookings|length }}{{ info.tickets }}{{ info.payed|length }} +{{ show }}{{ info.bookings|length }}{{ info.tickets }}{{ info.payed }} {% endfor %} diff --git a/tickets/views.py b/tickets/views.py index 5b7ab75..1764301 100644 --- a/tickets/views.py +++ b/tickets/views.py @@ -137,7 +137,7 @@ def bookings(request): shows.append((show_desc, { 'bookings' : bookings, 'tickets' : sum([b.tickets for b in bookings]), - 'payed' : Booking.objects.filter(show=show, payment__isnull=False), + 'payed' : sum([b.tickets for b in bookings if b.payment is not None]), })) c = { 'shows' : shows } -- 2.30.2