Sendmail: Fix invalid state if attachment is adde then removed

This commit is contained in:
Raphael Michel
2021-09-23 17:36:33 +02:00
parent 720d9b924e
commit 1d4afa5d27

View File

@@ -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(