mirror of
https://github.com/pretix/pretix.git
synced 2026-08-24 13:02:00 +00:00
include only products with an enabled waitinglist in the product field
This commit is contained in:
@@ -97,7 +97,10 @@ class WaitingListEntryEditForm(I18nModelForm):
|
||||
choices = []
|
||||
|
||||
items = self.event.items.prefetch_related('variations')
|
||||
|
||||
for item in items:
|
||||
if not item.allow_waitinglist:
|
||||
continue
|
||||
if len(item.variations.all()) > 0:
|
||||
for v in item.variations.all():
|
||||
choices.append((
|
||||
@@ -110,6 +113,7 @@ class WaitingListEntryEditForm(I18nModelForm):
|
||||
f'<strike class="text-muted">{escape(item)}</strike>')))
|
||||
|
||||
self.fields['itemvar'].label = _("Product")
|
||||
self.fields['itemvar'].help_text = _("Only includes Products with an enabled waiting list.")
|
||||
self.fields['itemvar'].required = True
|
||||
self.fields['itemvar'].widget = Select2ItemVarQuota(
|
||||
attrs={
|
||||
|
||||
@@ -61,7 +61,7 @@ def env():
|
||||
item2 = Item.objects.create(event=event, name="Ticket", default_price=23,
|
||||
admission=True)
|
||||
item3 = Item.objects.create(event=event, name="Ticket", default_price=23,
|
||||
admission=True)
|
||||
admission=True, allow_waitinglist=True)
|
||||
variation = ItemVariation.objects.create(item=item3)
|
||||
|
||||
for i in range(5):
|
||||
|
||||
Reference in New Issue
Block a user