Fix missing last basket

This commit is contained in:
Gabriel Augendre 2022-04-26 20:46:44 +02:00
parent 0afb46691f
commit f9b207a5eb

View file

@ -89,10 +89,12 @@ class ReportsView(ProtectedViewsMixin, TemplateView):
basket = baskets[basket_index] basket = baskets[basket_index]
count = 0 count = 0
turnover = 0 turnover = 0
while basket.created_at < end_slot and basket_index < len(baskets) - 1: while basket.created_at < end_slot:
count += 1 count += 1
turnover += basket.price / 100 turnover += basket.price / 100
basket_index += 1 basket_index += 1
if basket_index == len(baskets):
break
basket = baskets[basket_index] basket = baskets[basket_index]
labels.append(current) labels.append(current)
counts.append(count) counts.append(count)