forked from CGM_Public/pretix_original
Fix redemption of all-product vouchers with seating plans
This commit is contained in:
@@ -460,7 +460,7 @@ class Voucher(LoggedModel):
|
||||
|
||||
return Order.objects.filter(all_positions__voucher__in=[self]).distinct()
|
||||
|
||||
def seating_available(self):
|
||||
def seating_available(self, subevent):
|
||||
kwargs = {}
|
||||
if self.subevent:
|
||||
kwargs['subevent'] = self.subevent
|
||||
@@ -469,4 +469,4 @@ class Voucher(LoggedModel):
|
||||
elif self.item_id:
|
||||
return self.item.seat_category_mappings.filter(**kwargs).exists()
|
||||
else:
|
||||
return False
|
||||
return bool(subevent.seating_plan) if subevent else self.event.seating_plan
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<input type="hidden" name="subevent" value="{{ subevent.id|default_if_none:"" }}" />
|
||||
<input type="hidden" name="_voucher_code" value="{{ voucher.code }}">
|
||||
|
||||
{% if voucher.seating_available %}
|
||||
{% if seating_available %}
|
||||
{% if event.has_subevents %}
|
||||
{% eventsignal event "pretix.presale.signals.render_seating_plan" request=request subevent=subevent voucher=voucher %}
|
||||
{% else %}
|
||||
|
||||
@@ -435,6 +435,7 @@ class RedeemView(NoSearchIndexViewMixin, EventViewMixin, TemplateView):
|
||||
context['items_by_category'] = item_group_by_category(items)
|
||||
|
||||
context['subevent'] = self.subevent
|
||||
context['seating_available'] = self.voucher.seating_available(self.subevent)
|
||||
|
||||
context['new_tab'] = (
|
||||
'require_cookie' in self.request.GET and
|
||||
|
||||
Reference in New Issue
Block a user