Sendmail: Allow manual payment reminders

This commit is contained in:
Raphael Michel
2016-08-04 17:55:44 +02:00
parent 39ada8954e
commit 17d5221579
2 changed files with 20 additions and 11 deletions

View File

@@ -6,10 +6,7 @@ from pretix.base.models import Order
class MailForm(forms.Form):
sendto = forms.MultipleChoiceField(
label=_("Send to"), widget=forms.CheckboxSelectMultiple,
choices=Order.STATUS_CHOICE
)
sendto = forms.MultipleChoiceField() # overridden later
subject = forms.CharField(label=_("Subject"))
message = forms.CharField(label=_("Message"))
@@ -24,3 +21,12 @@ class MailForm(forms.Form):
widget=I18nTextarea, required=True,
langcodes=event.settings.get('locales')
)
choices = list(Order.STATUS_CHOICE)
if not event.settings.get('payment_term_expire_automatically', as_type=bool):
choices.append(
('overdue', _('pending with payment overdue'))
)
self.fields['sendto'] = forms.MultipleChoiceField(
label=_("Send to"), widget=forms.CheckboxSelectMultiple,
choices=choices
)