mirror of
https://github.com/pretix/pretix.git
synced 2026-08-26 13:14:40 +00:00
Event product list: Hotfix for pathological performance in large event series (#6318)
* Event product list: Hotfix for pathological performance * Stop outputting bullsht numbers to widget
This commit is contained in:
@@ -215,7 +215,6 @@ def get_grouped_items(event, *, channel: SalesChannel, subevent=None, voucher=No
|
||||
prefetch_var,
|
||||
prefetch_bundles,
|
||||
).annotate(
|
||||
quotac=Count('quotas'),
|
||||
has_variations=Count('variations'),
|
||||
subevent_disabled=Exists(
|
||||
SubEventItem.objects.filter(
|
||||
@@ -235,7 +234,8 @@ def get_grouped_items(event, *, channel: SalesChannel, subevent=None, voucher=No
|
||||
),
|
||||
requires_seat=requires_seat,
|
||||
).filter(
|
||||
quotac__gt=0, subevent_disabled=False,
|
||||
Exists(Quota.items.through.objects.filter(quota__subevent_id=subevent, item_id=OuterRef("pk"))),
|
||||
subevent_disabled=False,
|
||||
).order_by('category__position', 'category_id', 'position', 'name')
|
||||
if require_seat:
|
||||
items = items.filter(requires_seat__gt=0)
|
||||
|
||||
@@ -352,7 +352,7 @@ class WidgetAPIProductList(EventListMixin, View):
|
||||
'picture': get_picture(self.request.event, item.picture, '60x60^') if item.picture else None,
|
||||
'picture_fullsize': get_picture(self.request.event, item.picture) if item.picture else None,
|
||||
'description': str(rich_text(item.description, safelinks=False)) if item.description else None,
|
||||
'has_variations': item.has_variations,
|
||||
'has_variations': bool(item.has_variations),
|
||||
'current_unavailability_reason': item.current_unavailability_reason,
|
||||
'order_min': item.min_per_order,
|
||||
'order_max': item.order_max if not item.has_variations else None,
|
||||
|
||||
Reference in New Issue
Block a user