diff --git a/src/pretix/base/models/orders.py b/src/pretix/base/models/orders.py index ffcd5021ba..abdfb77f0c 100644 --- a/src/pretix/base/models/orders.py +++ b/src/pretix/base/models/orders.py @@ -902,7 +902,7 @@ class Order(LockModel, LoggedModel): @property def positions_with_tickets(self): - for op in self.positions.all(): + for op in self.positions.select_related('item'): if not op.generate_ticket: continue yield op @@ -1155,7 +1155,7 @@ class AbstractPosition(models.Model): (2) questions: a list of Question objects, extended by an 'answer' property """ self.answ = {} - for a in self.answers.all(): + for a in getattr(self, 'answerlist', self.answers.all()): # use prefetch_related cache from get_cart self.answ[a.question_id] = a # We need to clone our question objects, otherwise we will override the cached diff --git a/src/pretix/base/services/quotas.py b/src/pretix/base/services/quotas.py index bec49ba808..d9f6fc37c8 100644 --- a/src/pretix/base/services/quotas.py +++ b/src/pretix/base/services/quotas.py @@ -113,10 +113,11 @@ class QuotaAvailability: raise e def _write_cache(self, quotas, now_dt): - events = {q.event for q in quotas} + # We used to also delete item_quota_cache:* from the event cache here, but as the cache + # gets more complex, this does not seem worth it. The cache is only present for up to + # 5 seconds to prevent high peaks, and a 5-second delay in availability is usually + # tolerable update = [] - for e in events: - e.cache.delete('item_quota_cache') for q in quotas: rewrite_cache = self._count_waitinglist and ( not q.cache_is_hot(now_dt) or self.results[q][0] > q.cached_availability_state diff --git a/src/pretix/presale/checkoutflow.py b/src/pretix/presale/checkoutflow.py index 4163f0c6e3..98a5590482 100644 --- a/src/pretix/presale/checkoutflow.py +++ b/src/pretix/presale/checkoutflow.py @@ -673,7 +673,7 @@ class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep): return ctx -class PaymentStep(QuestionsViewMixin, CartMixin, TemplateFlowStep): +class PaymentStep(CartMixin, TemplateFlowStep): priority = 200 identifier = "payment" template_name = "pretixpresale/event/checkout_payment.html" diff --git a/src/pretix/presale/templates/pretixpresale/event/order.html b/src/pretix/presale/templates/pretixpresale/event/order.html index 85a21a606e..f70746370e 100644 --- a/src/pretix/presale/templates/pretixpresale/event/order.html +++ b/src/pretix/presale/templates/pretixpresale/event/order.html @@ -313,7 +313,7 @@ {% endif %}
- {% if order.user_change_allowed or order.user_cancel_allowed %} + {% if user_change_allowed or user_cancel_allowed %}

@@ -321,7 +321,7 @@