From 72b6ff0389b74873685e1426e3cac9e6cebbc099 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Fri, 12 Feb 2021 12:34:04 +0100 Subject: [PATCH] Sendmail form: Fix validation problems --- src/pretix/plugins/sendmail/forms.py | 2 +- .../sendmail/templates/pretixplugins/sendmail/send_form.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pretix/plugins/sendmail/forms.py b/src/pretix/plugins/sendmail/forms.py index 6212b72d7..b8f24e030 100644 --- a/src/pretix/plugins/sendmail/forms.py +++ b/src/pretix/plugins/sendmail/forms.py @@ -68,7 +68,7 @@ class MailForm(forms.Form): def clean(self): d = super().clean() - if d.get('subevent') and d.get('subevents_from'): + if d.get('subevent') and (d.get('subevents_from') or d.get('subevents_to')): raise ValidationError(pgettext_lazy('subevent', 'Please either select a specific date or a date range, not both.')) if bool(d.get('subevents_from')) != bool(d.get('subevents_to')): raise ValidationError(pgettext_lazy('subevent', 'If you set a date range, please set both a start and an end.')) diff --git a/src/pretix/plugins/sendmail/templates/pretixplugins/sendmail/send_form.html b/src/pretix/plugins/sendmail/templates/pretixplugins/sendmail/send_form.html index a67794e1c..505e71e46 100644 --- a/src/pretix/plugins/sendmail/templates/pretixplugins/sendmail/send_form.html +++ b/src/pretix/plugins/sendmail/templates/pretixplugins/sendmail/send_form.html @@ -7,6 +7,7 @@ {% block inner %}
{% csrf_token %} + {% bootstrap_form_errors form %} {% bootstrap_field form.recipients layout='horizontal' %} {% bootstrap_field form.sendto layout='horizontal' %} {% if form.subevent %}