From ed3542e219cc3779278cf15b53388cd4d2e94915 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 20 Jul 2020 10:10:36 +0200 Subject: [PATCH] Fix error in quota statistics --- src/pretix/base/services/quotas.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pretix/base/services/quotas.py b/src/pretix/base/services/quotas.py index 7617e91c39..22f99c5eed 100644 --- a/src/pretix/base/services/quotas.py +++ b/src/pretix/base/services/quotas.py @@ -261,15 +261,15 @@ class QuotaAvailability: qs = self._item_to_quotas[line['item_id']] for q in qs: if q.subevent_id == line['subevent_id']: + if line['order__status'] == Order.STATUS_PAID: + self.count_paid_orders[q] += line['c'] + q.cached_availability_paid_orders = self.count_paid_orders[q] + elif line['order__status'] == Order.STATUS_PENDING: + self.count_pending_orders[q] += line['c'] if q.release_after_exit and line['is_exited']: self.count_exited_orders[q] += line['c'] else: size_left[q] -= line['c'] - if line['order__status'] == Order.STATUS_PAID: - self.count_paid_orders[q] += line['c'] - q.cached_availability_paid_orders = self.count_paid_orders[q] - elif line['order__status'] == Order.STATUS_PENDING: - self.count_pending_orders[q] += line['c'] if size_left[q] <= 0 and q not in self.results: if line['order__status'] == Order.STATUS_PAID: self.results[q] = Quota.AVAILABILITY_GONE, 0