From 1d4afa5d27d3f7aad845ac9993b3e57935325306 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 23 Sep 2021 17:36:33 +0200 Subject: [PATCH] Sendmail: Fix invalid state if attachment is adde then removed --- src/pretix/plugins/sendmail/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pretix/plugins/sendmail/views.py b/src/pretix/plugins/sendmail/views.py index 4dd76d1a4..edcdc12d3 100644 --- a/src/pretix/plugins/sendmail/views.py +++ b/src/pretix/plugins/sendmail/views.py @@ -229,7 +229,8 @@ class SenderView(EventPermissionRequiredMixin, FormView): 'checkin_lists': [i.pk for i in form.cleaned_data.get('checkin_lists')], 'filter_checkins': form.cleaned_data.get('filter_checkins'), } - if form.cleaned_data.get('attachment') is not None: + attachment = form.cleaned_data.get('attachment') + if attachment is not None and attachment is not False: kwargs['attachments'] = [form.cleaned_data['attachment'].id] send_mails.apply_async(