mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
Separate personalization from admission (#2990)
Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -985,22 +985,22 @@ class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
|
||||
if warn:
|
||||
messages.warning(request, _('Please fill in answers to all required questions.'))
|
||||
return False
|
||||
if cp.item.admission and self.request.event.settings.get('attendee_names_required', as_type=bool) \
|
||||
if cp.item.ask_attendee_data and self.request.event.settings.get('attendee_names_required', as_type=bool) \
|
||||
and not cp.attendee_name_parts:
|
||||
if warn:
|
||||
messages.warning(request, _('Please fill in answers to all required questions.'))
|
||||
return False
|
||||
if cp.item.admission and self.request.event.settings.get('attendee_emails_required', as_type=bool) \
|
||||
if cp.item.ask_attendee_data and self.request.event.settings.get('attendee_emails_required', as_type=bool) \
|
||||
and cp.attendee_email is None:
|
||||
if warn:
|
||||
messages.warning(request, _('Please fill in answers to all required questions.'))
|
||||
return False
|
||||
if cp.item.admission and self.request.event.settings.get('attendee_company_required', as_type=bool) \
|
||||
if cp.item.ask_attendee_data and self.request.event.settings.get('attendee_company_required', as_type=bool) \
|
||||
and cp.company is None:
|
||||
if warn:
|
||||
messages.warning(request, _('Please fill in answers to all required questions.'))
|
||||
return False
|
||||
if cp.item.admission and self.request.event.settings.get('attendee_attendees_required', as_type=bool) \
|
||||
if cp.item.ask_attendee_data and self.request.event.settings.get('attendee_attendees_required', as_type=bool) \
|
||||
and (cp.street is None or cp.city is None or cp.country is None):
|
||||
if warn:
|
||||
messages.warning(request, _('Please fill in answers to all required questions.'))
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
</summary>
|
||||
<div>
|
||||
<div class="panel-body questions-form">
|
||||
{% if event.settings.attendee_data_explanation_text and pos.item.admission %}
|
||||
{% if event.settings.attendee_data_explanation_text and pos.item.ask_attendee_data %}
|
||||
{{ event.settings.attendee_data_explanation_text|rich_text }}
|
||||
{% endif %}
|
||||
{% if pos.seat %}
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
{% endif %}
|
||||
{% if line.has_questions %}
|
||||
<dl class="dl-indented">
|
||||
{% if line.item.admission %}
|
||||
{% if line.item.ask_attendee_data %}
|
||||
{% if event.settings.attendee_names_asked %}
|
||||
<dt class="sr-only">
|
||||
{% trans "Attendee name" %}
|
||||
|
||||
@@ -149,7 +149,7 @@ class CartMixin:
|
||||
# We do this by list manipulations instead of a GROUP BY query, as
|
||||
# Django is unable to join related models in a .values() query
|
||||
def group_key(pos): # only used for grouping, sorting is done before already
|
||||
has_attendee_data = pos.item.admission and (
|
||||
has_attendee_data = pos.item.ask_attendee_data and (
|
||||
self.request.event.settings.attendee_names_asked
|
||||
or self.request.event.settings.attendee_emails_asked
|
||||
or self.request.event.settings.attendee_company_asked
|
||||
|
||||
Reference in New Issue
Block a user