Re-structure some querying on cart and order pages to reduce load

This commit is contained in:
Raphael Michel
2020-12-13 16:29:17 +01:00
parent 5308099d84
commit 571fef4ed8
7 changed files with 48 additions and 39 deletions

View File

@@ -245,6 +245,8 @@ class OrderDetails(EventViewMixin, OrderDetailMixin, CartMixin, TicketPageMixin,
).exclude(
provider__in=('offsetting', 'reseller', 'boxoffice', 'manual')
)
ctx['user_change_allowed'] = self.order.user_change_allowed
ctx['user_cancel_allowed'] = self.order.user_cancel_allowed
for r in ctx['refunds']:
if r.provider == 'giftcard':
gc = GiftCard.objects.get(pk=r.info_data.get('gift_card'))