diff --git a/src/backoffice/templates/ticket_stats.html b/src/backoffice/templates/ticket_stats.html index ca2715a1..ecf34f02 100644 --- a/src/backoffice/templates/ticket_stats.html +++ b/src/backoffice/templates/ticket_stats.html @@ -14,9 +14,7 @@ Ticket Type - Number Sold - Total Income - Average Price + Tickets Generated Products @@ -25,8 +23,6 @@ {{ tt.name }} {{ tt.shopticket_count }} - {{ tt.total_price|floatformat:"2" }} DKK - {{ tt.average_price|floatformat:"2" }} DKK {{ tt.product_set.count }} {% endfor %} diff --git a/src/tickets/models.py b/src/tickets/models.py index 767e4271..7680da51 100644 --- a/src/tickets/models.py +++ b/src/tickets/models.py @@ -18,12 +18,8 @@ logger = logging.getLogger("bornhack.%s" % __name__) class TicketTypeManager(models.Manager): def with_price_stats(self): - return ( - self.annotate(shopticket_count=models.Count("shopticket")) - .annotate(average_price=models.Avg("shopticket__product__price")) - .annotate(total_price=models.Sum("shopticket__product__price")) - .exclude(shopticket_count=0) - .order_by("total_price") + return self.annotate(shopticket_count=models.Count("shopticket")).exclude( + shopticket_count=0 )