From 119a2d3ebf5b9191d8fa3897d94fdc2d9d7a936b Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 15 Nov 2023 15:22:06 +0700 Subject: [PATCH] fix: exception --- basxconnect/invoicing/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/basxconnect/invoicing/views.py b/basxconnect/invoicing/views.py index 88b5d2e0..72690635 100644 --- a/basxconnect/invoicing/views.py +++ b/basxconnect/invoicing/views.py @@ -82,7 +82,11 @@ def send_message( email = EmailMessage( subject=send_form.cleaned_data["subject"], body=send_form.cleaned_data["body"], - to=[recp["recipient"] for recp in recipient_formset.cleaned_data], + to=[ + recp["recipient"] + for recp in recipient_formset.cleaned_data + if "recipient" in recp + ], ) filename, data = send_form.cleaned_data["template"].generate_document_pdf( invoice