forked from CGM_Public/pretix_original
Cart expiry handling, checkout link
This commit is contained in:
23
src/pretix/presale/views/checkout.py
Normal file
23
src/pretix/presale/views/checkout.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from django.contrib import messages
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.shortcuts import redirect
|
||||
from django.views.generic import View
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from pretix.presale.views import EventViewMixin, CartDisplayMixin
|
||||
|
||||
|
||||
class CheckoutStart(EventViewMixin, CartDisplayMixin, View):
|
||||
|
||||
def get_failure_url(self):
|
||||
return reverse('presale:event.index', kwargs={
|
||||
'event': self.request.event.slug,
|
||||
'organizer': self.request.event.organizer.slug,
|
||||
})
|
||||
|
||||
def get(self, *args, **kwargs):
|
||||
cart = self.get_cart()
|
||||
if not cart['positions']:
|
||||
messages.error(self.request,
|
||||
_("Your cart is empty") % self.event.max_items_per_order)
|
||||
return redirect(self.get_failure_url())
|
||||
Reference in New Issue
Block a user