From f8df66e621c11ccc379f8cf085cc50f2aa36141f Mon Sep 17 00:00:00 2001 From: Mira Date: Mon, 21 Oct 2024 13:27:43 +0200 Subject: [PATCH] Redirect to next step if AddOnsStep would show up empty (Z#23167007) (#4530) --- src/pretix/presale/checkoutflow.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pretix/presale/checkoutflow.py b/src/pretix/presale/checkoutflow.py index 781c4167f..371e89492 100644 --- a/src/pretix/presale/checkoutflow.py +++ b/src/pretix/presale/checkoutflow.py @@ -47,6 +47,7 @@ from django.db import models from django.db.models import Count, F, Q, Sum from django.db.models.functions import Cast from django.http import HttpResponseNotAllowed, JsonResponse +from django.shortcuts import redirect from django.utils import translation from django.utils.functional import cached_property from django.utils.translation import ( @@ -659,6 +660,8 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep): self.request = request if 'async_id' in request.GET and settings.HAS_CELERY: return self.get_result(request) + if len(self.forms) == 0 and len(self.cross_selling_data) == 0: + return redirect(self.get_next_url(request)) return TemplateFlowStep.get(self, request) def _clean_category(self, form, category):