mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
* Vendor vue.js * Refactor item_group_by_category to support vouchers * Widget: Show product list * Widget: free prices * Widget: pictures and loading indicator * Widget: First iframe steps * Widget: Do not rerender iframe * Widget: Error handling * Improve widget * Widget: localization tech * Fix invoice style * Voucher attribute and waiting list * Add some iframe chrome * First step to namespaced carts * More isolation steps * More cart isolation things * More cart isolation things * Mobile stuff * Show cart on checkout pages * PayPal and Stripe support * Enable downloads * Locale handling * change text "save URL to this exact page" * Widget: voucher redemption * Widget: CSS * CSS: Responsive * Widget: CSS improvements * Widget: Add embedding code generator * Widget: Error messages and SSL check * First tests * Widget: tests * Don't use IDs in widgets * Widget: static files caching
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
from django.contrib import messages
|
||||
from django.shortcuts import get_object_or_404, redirect
|
||||
from django.utils import translation
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.translation import pgettext_lazy, ugettext_lazy as _
|
||||
from django.views.generic import FormView
|
||||
|
||||
from pretix.base.models.event import SubEvent
|
||||
from pretix.presale.views import EventViewMixin
|
||||
|
||||
from . import allow_frame_if_namespaced
|
||||
from ...base.models import Item, ItemVariation, WaitingListEntry
|
||||
from ...multidomain.urlreverse import eventreverse
|
||||
from ..forms.waitinglist import WaitingListForm
|
||||
|
||||
|
||||
class WaitingView(FormView):
|
||||
@method_decorator(allow_frame_if_namespaced, 'dispatch')
|
||||
class WaitingView(EventViewMixin, FormView):
|
||||
template_name = 'pretixpresale/event/waitinglist.html'
|
||||
form_class = WaitingListForm
|
||||
|
||||
@@ -52,11 +55,11 @@ class WaitingView(FormView):
|
||||
|
||||
if not self.request.event.settings.waiting_list_enabled:
|
||||
messages.error(request, _("Waiting lists are disabled for this event."))
|
||||
return redirect(eventreverse(self.request.event, 'presale:event.index'))
|
||||
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(eventreverse(self.request.event, 'presale:event.index'))
|
||||
return redirect(self.get_index_url())
|
||||
|
||||
self.subevent = None
|
||||
if request.event.has_subevents:
|
||||
@@ -65,7 +68,7 @@ class WaitingView(FormView):
|
||||
active=True)
|
||||
else:
|
||||
messages.error(request, pgettext_lazy('subevent', "You need to select a date."))
|
||||
return redirect(eventreverse(self.request.event, 'presale:event.index'))
|
||||
return redirect(self.get_index_url())
|
||||
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
||||
@@ -78,7 +81,7 @@ class WaitingView(FormView):
|
||||
if availability[0] == 100:
|
||||
messages.error(self.request, _("You cannot add yourself to the waiting list as this product is currently "
|
||||
"available."))
|
||||
return redirect(eventreverse(self.request.event, 'presale:event.index'))
|
||||
return redirect(self.get_index_url())
|
||||
|
||||
form.save()
|
||||
messages.success(self.request, _("We've added you to the waiting list. You will receive "
|
||||
@@ -86,4 +89,4 @@ class WaitingView(FormView):
|
||||
return super().form_valid(form)
|
||||
|
||||
def get_success_url(self):
|
||||
return eventreverse(self.request.event, 'presale:event.index')
|
||||
return self.get_index_url()
|
||||
|
||||
Reference in New Issue
Block a user