forked from CGM_Public/pretix_original
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])
|
for item in items])
|
||||||
|
|
||||||
context['allfree'] = all(
|
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(
|
) and all(
|
||||||
all(
|
all(
|
||||||
var.display_price.gross == Decimal('0.00')
|
var.display_price.gross == Decimal('0.00')
|
||||||
for var in item.available_variations
|
for var in item.available_variations
|
||||||
)
|
) and not item.mandatory_priced_addons
|
||||||
for item in items if item.has_variations
|
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]
|
items = [i for i in items if not i.requires_seat]
|
||||||
context['itemnum'] = len(items)
|
context['itemnum'] = len(items)
|
||||||
context['allfree'] = all(
|
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(
|
) and all(
|
||||||
all(
|
all(
|
||||||
var.display_price.gross == Decimal('0.00')
|
var.display_price.gross == Decimal('0.00')
|
||||||
for var in item.available_variations
|
for var in item.available_variations
|
||||||
)
|
) and not item.mandatory_priced_addons
|
||||||
for item in items if item.has_variations
|
for item in items if item.has_variations
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1020,7 +1020,7 @@ Vue.component('pretix-widget-event-form', {
|
|||||||
break;
|
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;
|
all_free = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user