forked from CGM_Public/pretix_original
Fix waiting list assignment for subevents
This commit is contained in:
@@ -22,7 +22,7 @@ def assign_automatically(event: Event, user_id: int=None, subevent_id: int=None)
|
|||||||
|
|
||||||
qs = WaitingListEntry.objects.filter(
|
qs = WaitingListEntry.objects.filter(
|
||||||
event=event, voucher__isnull=True
|
event=event, voucher__isnull=True
|
||||||
).select_related('item', 'variation').prefetch_related(
|
).select_related('item', 'variation', 'subevent').prefetch_related(
|
||||||
'item__quotas', 'variation__quotas'
|
'item__quotas', 'variation__quotas'
|
||||||
).order_by('-priority', 'created')
|
).order_by('-priority', 'created')
|
||||||
|
|
||||||
@@ -40,6 +40,8 @@ def assign_automatically(event: Event, user_id: int=None, subevent_id: int=None)
|
|||||||
ev = (wle.subevent or event)
|
ev = (wle.subevent or event)
|
||||||
if not ev.presale_is_running or (wle.subevent and not wle.subevent.active):
|
if not ev.presale_is_running or (wle.subevent and not wle.subevent.active):
|
||||||
continue
|
continue
|
||||||
|
if wle.subevent and not wle.subevent.presale_is_running:
|
||||||
|
continue
|
||||||
|
|
||||||
quotas = (wle.variation.quotas.filter(subevent=wle.subevent)
|
quotas = (wle.variation.quotas.filter(subevent=wle.subevent)
|
||||||
if wle.variation
|
if wle.variation
|
||||||
@@ -75,5 +77,5 @@ def process_waitinglist(sender, **kwargs):
|
|||||||
live=True
|
live=True
|
||||||
).prefetch_related('_settings_objects', 'organizer___settings_objects').select_related('organizer')
|
).prefetch_related('_settings_objects', 'organizer___settings_objects').select_related('organizer')
|
||||||
for e in qs:
|
for e in qs:
|
||||||
if e.settings.waiting_list_auto and e.presale_is_running:
|
if e.settings.waiting_list_auto and (e.presale_is_running or e.has_subevents):
|
||||||
assign_automatically.apply_async(args=(e.pk,))
|
assign_automatically.apply_async(args=(e.pk,))
|
||||||
|
|||||||
Reference in New Issue
Block a user