mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Do not treat event as free if there are mandatory non-free addons (#3646)
This commit is contained in:
@@ -571,12 +571,13 @@ class RedeemView(NoSearchIndexViewMixin, EventViewMixin, CartMixin, TemplateView
|
||||
for item in items])
|
||||
|
||||
context['allfree'] = all(
|
||||
item.display_price.gross == Decimal('0.00') for item in items if not item.has_variations
|
||||
item.display_price.gross == Decimal('0.00') and not item.mandatory_priced_addons
|
||||
for item in items if not item.has_variations
|
||||
) and all(
|
||||
all(
|
||||
var.display_price.gross == Decimal('0.00')
|
||||
for var in item.available_variations
|
||||
)
|
||||
) and not item.mandatory_priced_addons
|
||||
for item in items if item.has_variations
|
||||
)
|
||||
|
||||
|
||||
@@ -516,12 +516,13 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
|
||||
items = [i for i in items if not i.requires_seat]
|
||||
context['itemnum'] = len(items)
|
||||
context['allfree'] = all(
|
||||
item.display_price.gross == Decimal('0.00') for item in items if not item.has_variations
|
||||
item.display_price.gross == Decimal('0.00') and not item.mandatory_priced_addons
|
||||
for item in items if not item.has_variations
|
||||
) and all(
|
||||
all(
|
||||
var.display_price.gross == Decimal('0.00')
|
||||
for var in item.available_variations
|
||||
)
|
||||
) and not item.mandatory_priced_addons
|
||||
for item in items if item.has_variations
|
||||
)
|
||||
|
||||
|
||||
@@ -1020,7 +1020,7 @@ Vue.component('pretix-widget-event-form', {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (item.variations.length === 0 && item.price.gross !== "0.00") {
|
||||
if ((item.variations.length === 0 && item.price.gross !== "0.00") || item.mandatory_priced_addons) {
|
||||
all_free = false;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user