Check Event.presale_is_running in more places

This commit is contained in:
Raphael Michel
2017-05-10 15:04:01 +02:00
parent 74259bd4c6
commit 36215a989a
2 changed files with 5 additions and 1 deletions

View File

@@ -8,7 +8,7 @@
{% block title %}{% trans "Presale" %}{% endblock %}
{% block content %}
{% if cart.positions %}
{% if cart.positions and event.presale_is_running %}
<div class="panel panel-primary cart">
<div class="panel-heading">
<h3 class="panel-title">{% trans "Your cart" %}</h3>

View File

@@ -22,6 +22,10 @@ class CheckoutView(View):
messages.error(request, _("Your cart is empty"))
return redirect(eventreverse(self.request.event, 'presale:event.index'))
if not request.event.presale_is_running:
messages.error(request, _("The presale for this event is over or has not yet started."))
return redirect(eventreverse(self.request.event, 'presale:event.index'))
cart_error = None
try:
validate_cart.send(sender=self.request.event, positions=cart_pos)