Add attendee email field (#466)

* Add attendee email field

* exports, tests
This commit is contained in:
Raphael Michel
2017-04-13 22:59:54 +02:00
committed by GitHub
parent 3c59a870e7
commit e4706dd3ba
16 changed files with 155 additions and 4 deletions

View File

@@ -9,7 +9,10 @@ from pretix.base.models.orders import InvoiceAddress
class ContactForm(forms.Form):
email = forms.EmailField(label=_('E-mail'))
email = forms.EmailField(label=_('E-mail'),
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.'))
class InvoiceAddressForm(forms.ModelForm):
@@ -67,6 +70,12 @@ class QuestionsForm(forms.Form):
label=_('Attendee name'),
initial=(cartpos.attendee_name if cartpos else orderpos.attendee_name)
)
if item.admission and event.settings.attendee_emails_asked:
self.fields['attendee_email'] = forms.EmailField(
required=event.settings.attendee_emails_required,
label=_('Attendee email'),
initial=(cartpos.attendee_email if cartpos else orderpos.attendee_email)
)
for q in questions:
# Do we already have an answer? Provide it as the initial value