forked from CGM_Public/pretix_original
Redirect to next step if AddOnsStep would show up empty (Z#23167007) (#4530)
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user