Make validate_cart useful together with addons

This commit is contained in:
Raphael Michel
2017-05-02 10:20:28 +02:00
parent 48a933b757
commit 6b17388bd8
2 changed files with 13 additions and 2 deletions

View File

@@ -27,6 +27,8 @@ from pretix.presale.views.questions import QuestionsViewMixin
class BaseCheckoutFlowStep:
requires_valid_cart = True
def __init__(self, event):
self.event = event
self.request = None
@@ -135,6 +137,7 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep):
template_name = "pretixpresale/event/checkout_addons.html"
task = set_cart_addons
known_errortypes = ['CartError']
requires_valid_cart = False
def is_applicable(self, request):
return get_cart(request).filter(item__addons__isnull=False).exists()