Add Item.allow_waitinglist

This commit is contained in:
Raphael Michel
2019-07-29 16:27:27 +02:00
parent c60d1c8a5d
commit ad8f109e77
9 changed files with 44 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
{% if avail <= 10 %}
<div class="col-md-2 col-xs-6 availability-box gone">
<strong>{% trans "SOLD OUT" %}</strong>
{% if event.settings.waiting_list_enabled %}
{% if event.settings.waiting_list_enabled 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"></span>
@@ -17,7 +17,7 @@
<span class="fa fa-info-circle" data-toggle="tooltip"
title="{% trans "All remaining products are reserved but might become available again." %}"></span>
</strong>
{% if event.settings.waiting_list_enabled %}
{% if event.settings.waiting_list_enabled 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"></span>

View File

@@ -81,6 +81,10 @@ class WaitingView(EventViewMixin, FormView):
messages.error(request, _("We could not identify the product you selected."))
return redirect(self.get_index_url())
if not self.item_and_variation[0].allow_waitinglist:
messages.error(request, _("The waiting list is disabled for this product."))
return redirect(self.get_index_url())
self.subevent = None
if request.event.has_subevents:
if 'subevent' in request.GET: