Add support for orders without email addresses

This commit is contained in:
Raphael Michel
2018-02-04 22:42:41 +01:00
parent a5af7a70f3
commit 4ccf33af03
12 changed files with 83 additions and 56 deletions

View File

@@ -522,6 +522,7 @@ class ConfirmStep(CartMixin, AsyncAction, TemplateFlowStep):
for r, response in sorted(responses, key=lambda r: str(r[0])):
for key, value in response.items():
v = self.cart_session.get('contact_form_data', {}).get(key)
v = value.bound_data(v, initial='')
if v is True:
v = _('Yes')
elif v is False:

View File

@@ -14,6 +14,7 @@ from pretix.base.forms.questions import (
from pretix.base.models import ItemVariation
from pretix.base.models.tax import TAXED_ZERO
from pretix.base.templatetags.rich_text import rich_text
from pretix.base.validators import EmailBlacklistValidator
from pretix.presale.signals import contact_form_fields
@@ -23,6 +24,7 @@ class ContactForm(forms.Form):
help_text=_('Make sure to enter a valid email address. We will send you an order '
'confirmation including a link that you need in case you want to make '
'modifications to your order or download your ticket later.'),
validators=[EmailBlacklistValidator()],
widget=forms.EmailInput(attrs={'autofocus': 'autofocus'}))
def __init__(self, *args, **kwargs):

View File

@@ -120,10 +120,12 @@
</h3>
</div>
<div class="panel-body">
<dl class="dl-horizontal">
<dt>{% trans "E-mail address" %}</dt>
<dd>{{ cart_session.email }}</dd>
</dl>
{% if "email" not in contact_info.keys %}
<dl class="dl-horizontal">
<dt>{% trans "E-mail address" %}</dt>
<dd>{{ cart_session.email }}</dd>
</dl>
{% endif %}
{% for l, v in contact_info %}
<dl class="dl-horizontal">
<dt>{{ l }}</dt>