diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-03-25 11:46:29 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2024-12-21 19:43:13 +0200 |
| commit | 3231fbd478788dcde6e4bf87521bda7c462c5bee (patch) | |
| tree | ad86c731d28754fed07707ef4c8fabefe144341d /email_client.py | |
| parent | 26731ba6bd36b54ea2400d68c67e5ab22d840729 (diff) | |
Do not try to send email when recipient is an empty string
Diffstat (limited to 'email_client.py')
| -rw-r--r-- | email_client.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/email_client.py b/email_client.py index e06c901..8cad903 100644 --- a/email_client.py +++ b/email_client.py @@ -69,7 +69,7 @@ else: def send_participation_email(poll_id: str, voter_name: str): poll = db.get_poll(poll_id) - if not poll or poll.author_email is None: + if not poll or poll.author_email is None or poll.author_email.strip() == "": return print(f"Sending participation email to {poll.author_email}") @@ -88,7 +88,7 @@ def send_participation_email(poll_id: str, voter_name: str): def send_poll_created_email(poll_id: str): poll = db.get_poll(poll_id) - if not poll or poll.author_email is None: + if not poll or poll.author_email is None or poll.author_email.strip() == "": return print(f"Sending poll created email to {poll.author_email}") |
