Skip to content

Commit

Permalink
Presale: Fix booking period error message logic (Z#23115841) (#3832)
Browse files Browse the repository at this point in the history
* Fix presale start and end error message logic

* Improve readability
  • Loading branch information
ser8phin committed Jan 23, 2024
1 parent 7022e5b commit 0a154dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pretix/presale/views/cart.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,11 @@ def dispatch(self, request, *args, **kwargs):
context['show_cart'] = context['cart']['positions']
return render(request, 'pretixpresale/event/voucher_form.html', context)

if request.event.presale_start and now() < request.event.presale_start:
err = error_messages['not_started']
if request.event.presale_end and now() > request.event.presale_end:
if request.event.presale_has_ended or (request.event.presale_end and now() > request.event.presale_end):
err = error_messages['ended']
elif not request.event.presale_is_running or (
request.event.presale_start and now() < request.event.presale_start):
err = error_messages['not_started']

self.subevent = None
if request.event.has_subevents:
Expand Down

0 comments on commit 0a154dc

Please sign in to comment.