rename presale question forms and mixins

This commit is contained in:
Mira Weller
2026-08-06 20:05:44 +02:00
parent 4012889076
commit 3424aacdc3
4 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -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"
+5 -2
View File
@@ -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
+3 -3
View File
@@ -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"
+3 -3
View File
@@ -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