From 3424aacdc342bfa3390cc8597b121810112917b2 Mon Sep 17 00:00:00 2001 From: Mira Weller Date: Thu, 6 Aug 2026 20:05:44 +0200 Subject: [PATCH] rename presale question forms and mixins --- src/pretix/presale/checkoutflow.py | 4 ++-- src/pretix/presale/forms/checkout.py | 7 +++++-- src/pretix/presale/views/order.py | 6 +++--- src/pretix/presale/views/questions.py | 6 +++--- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/pretix/presale/checkoutflow.py b/src/pretix/presale/checkoutflow.py index 23966e90c1..622d3ffef4 100644 --- a/src/pretix/presale/checkoutflow.py +++ b/src/pretix/presale/checkoutflow.py @@ -100,7 +100,7 @@ from pretix.presale.views.cart import ( _items_from_post_data, cart_session, create_empty_cart_id, get_or_create_cart_id, ) -from pretix.presale.views.questions import QuestionsViewMixin +from pretix.presale.views.questions import CartQuestionsViewMixin class BaseCheckoutFlowStep: @@ -772,7 +772,7 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep): sales_channel=request.sales_channel.identifier, override_now_dt=time_machine_now(default=None)) -class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep): +class QuestionsStep(CartQuestionsViewMixin, CartMixin, TemplateFlowStep): priority = 50 identifier = "questions" template_name = "pretixpresale/event/checkout_questions.html" diff --git a/src/pretix/presale/forms/checkout.py b/src/pretix/presale/forms/checkout.py index 20740fadc9..b25a6f556c 100644 --- a/src/pretix/presale/forms/checkout.py +++ b/src/pretix/presale/forms/checkout.py @@ -139,11 +139,14 @@ class InvoiceNameForm(InvoiceAddressForm): del self.fields[f] -class QuestionsForm(BaseQuestionsForm): +class CustomerAwareQuestionsForm(BaseQuestionsForm): """ - This form class is responsible for asking order-related questions. This includes + The base class is responsible for asking order-related questions. This includes the attendee name for admission tickets, if the corresponding setting is enabled, as well as additional questions defined by the organizer. + + This class adds support for pre-filling data like name and address from a + customer profile, in case the user is logged-in with a customer account. """ required_css_class = 'required' address_validation = True diff --git a/src/pretix/presale/views/order.py b/src/pretix/presale/views/order.py index c131644631..cfded12e7b 100644 --- a/src/pretix/presale/views/order.py +++ b/src/pretix/presale/views/order.py @@ -90,7 +90,7 @@ from pretix.base.views.tasks import AsyncAction from pretix.helpers.http import redirect_to_url from pretix.helpers.safedownload import check_token from pretix.multidomain.urlreverse import eventreverse, eventreverse_absolute -from pretix.presale.forms.checkout import InvoiceAddressForm, QuestionsForm +from pretix.presale.forms.checkout import InvoiceAddressForm, CustomerAwareQuestionsForm from pretix.presale.forms.order import OrderPositionChangeForm from pretix.presale.productlist import prepare_item_list_for_shop from pretix.presale.signals import question_form_fields_overrides @@ -806,7 +806,7 @@ class OrderInvoiceCreate(EventViewMixin, OrderDetailMixin, View): @method_decorator(xframe_options_exempt, 'dispatch') class OrderModify(EventViewMixin, OrderDetailMixin, OrderQuestionsViewMixin, TemplateView): - form_class = QuestionsForm + form_class = CustomerAwareQuestionsForm invoice_form_class = InvoiceAddressForm template_name = "pretixpresale/event/order_modify.html" @@ -940,7 +940,7 @@ class OrderModify(EventViewMixin, OrderDetailMixin, OrderQuestionsViewMixin, Tem @method_decorator(xframe_options_exempt, 'dispatch') class OrderPositionModify(EventViewMixin, OrderPositionDetailMixin, OrderQuestionsViewMixin, TemplateView): - form_class = QuestionsForm + form_class = CustomerAwareQuestionsForm invoice_form_class = None template_name = "pretixpresale/event/position_modify.html" diff --git a/src/pretix/presale/views/questions.py b/src/pretix/presale/views/questions.py index fad52d0b6f..e4541e22c1 100644 --- a/src/pretix/presale/views/questions.py +++ b/src/pretix/presale/views/questions.py @@ -35,12 +35,12 @@ from django.utils.functional import cached_property from pretix.base.views.mixins import BaseQuestionsViewMixin -from pretix.presale.forms.checkout import QuestionsForm +from pretix.presale.forms.checkout import CustomerAwareQuestionsForm from pretix.presale.views import get_cart -class QuestionsViewMixin(BaseQuestionsViewMixin): - form_class = QuestionsForm +class CartQuestionsViewMixin(BaseQuestionsViewMixin): + form_class = CustomerAwareQuestionsForm only_user_visible = True @cached_property