From b9e3dab6cc7a2fd73b6d2201baeefadf081dded4 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 6 Oct 2019 18:38:43 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20:=20cas=20de=20non=20pr=C3=A9sence=20du?= =?UTF-8?q?=20mail,=20=C3=A9vite=20de=20spammer=20inutilement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 03c9178..6b522a3 100644 --- a/main.py +++ b/main.py @@ -47,12 +47,13 @@ def notif_end_adhesion(api_client): asso_name=asso_options["name"], message=result["message"], link=general_options["main_site_url"]) - api_sendmail.send_mail( - general_options["email_from"], - user["get_mail"], - "Avis de fin d'adhésion / End of subscription notice", - reminder_mail - ) + if user["get_mail"]: + api_sendmail.send_mail( + general_options["email_from"], + user["get_mail"], + "Avis de fin d'adhésion / End of subscription notice", + reminder_mail + ) ## Manual command if "--force" in sys.argv: