Fix waiting list availability calculation if WL vouchers have seats (Z#23226856)

This commit is contained in:
Kara Engelhardt
2026-03-09 13:37:08 +01:00
committed by pajowu
parent 99e9690d48
commit f3fb1e66dc
3 changed files with 81 additions and 7 deletions

View File

@@ -181,10 +181,11 @@ class WaitingListEntry(LoggedModel):
block_quota=True,
item_id=self.item_id,
subevent_id=self.subevent_id,
waitinglistentries__isnull=False
waitinglistentries__isnull=False,
seat__isnull=True
).aggregate(free=Sum(F('max_usages') - F('redeemed')))['free'] or 0
free_seats = num_free_seats_for_product - num_valid_vouchers_for_product
if not free_seats:
if free_seats < 1:
raise WaitingListException(_('No seat with this product is currently available.'))
if '@' not in self.email: