do not crap out when no tickets exist
This commit is contained in:
parent
b5dd97e935
commit
929cde010e
|
@ -231,6 +231,7 @@ class ShopTicketStatsDetailView(CampViewMixin, OrgaTeamPermissionMixin, ListView
|
|||
context["total_income"] += product.total_income
|
||||
context["total_cost"] += product.total_cost
|
||||
context["total_profit"] += product.total_profit
|
||||
if context["total_income"] and context["total_units"]:
|
||||
context["average_price"] = round(
|
||||
context["total_income"] / context["total_units"], 2
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue