forked from CGM_Public/pretix_original
Do not show waiting list if presale is over
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
{% else %}
|
||||
<strong>{% trans "SOLD OUT" %}</strong>
|
||||
{% endif %}
|
||||
{% if event.settings.waiting_list_enabled and item.allow_waitinglist %}
|
||||
{% if allow_waitinglist and item.allow_waitinglist %}
|
||||
<br/>
|
||||
<a href="{% eventurl event "presale:event.waitinglist" cart_namespace=cart_namespace|default_if_none:"" %}?item={{ item.pk }}{% if var %}&var={{ var.pk }}{% endif %}{% if subevent %}&subevent={{ subevent.pk }}{% endif %}">
|
||||
<span class="fa fa-plus-circle" aria-hidden="true"></span>
|
||||
@@ -20,7 +20,7 @@
|
||||
<strong>{% trans "Reserved" %}</strong>
|
||||
<br/>
|
||||
{% trans "All remaining products are reserved but might become available again." %}
|
||||
{% if event.settings.waiting_list_enabled and item.allow_waitinglist %}
|
||||
{% if allow_waitinglist and item.allow_waitinglist %}
|
||||
<br/>
|
||||
<a href="{% eventurl event "presale:event.waitinglist" cart_namespace=cart_namespace|default_if_none:"" %}?item={{ item.pk }}{% if var %}&var={{ var.pk }}{% endif %}{% if subevent %}&subevent={{ subevent.pk }}{% endif %}">
|
||||
<span class="fa fa-plus-circle" aria-hidden="true"></span>
|
||||
|
||||
@@ -439,7 +439,8 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
|
||||
context['ev'] = self.subevent or self.request.event
|
||||
context['subevent'] = self.subevent
|
||||
context['cart'] = self.get_cart()
|
||||
context['has_addon_choices'] = any(cp.has_addon_choices for cp in get_cart(self.request))\
|
||||
context['has_addon_choices'] = any(cp.has_addon_choices for cp in get_cart(self.request))
|
||||
context['allow_waitinglist'] = self.request.event.settings.waiting_list_enabled and context['ev'].presale_is_running
|
||||
|
||||
if self.subevent:
|
||||
context['frontpage_text'] = str(self.subevent.frontpage_text)
|
||||
|
||||
@@ -98,6 +98,14 @@ class WaitingView(EventViewMixin, FormView):
|
||||
messages.error(request, _("Waiting lists are disabled for this event."))
|
||||
return redirect(self.get_index_url())
|
||||
|
||||
if self.request.event.presale_has_ended:
|
||||
messages.error(request, _("The presale period for this event is over."))
|
||||
return redirect(self.get_index_url())
|
||||
|
||||
if not self.request.event.presale_is_running:
|
||||
messages.error(request, _("The presale for this event has not yet started."))
|
||||
return redirect(self.get_index_url())
|
||||
|
||||
if not self.item_and_variation:
|
||||
messages.error(request, _("We could not identify the product you selected."))
|
||||
return redirect(self.get_index_url())
|
||||
|
||||
Reference in New Issue
Block a user