From 119ecd774335c688c3a38d01e24b50c33c25630a Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 10 Jun 2022 11:53:47 +0200 Subject: [PATCH] feat(api): ignore weekly report if SMTP not configured --- api/chalicelib/core/weekly_report.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/chalicelib/core/weekly_report.py b/api/chalicelib/core/weekly_report.py index 3d857ccc0..bebdd9f6e 100644 --- a/api/chalicelib/core/weekly_report.py +++ b/api/chalicelib/core/weekly_report.py @@ -29,6 +29,9 @@ def edit_config(user_id, weekly_report): def cron(): + if not helper.has_smtp(): + print("!!! No SMTP configuration found, ignoring weekly report") + return with pg_client.PostgresClient(long_query=True) as cur: params = {"3_days_ago": TimeUTC.midnight(delta_days=-3), "1_week_ago": TimeUTC.midnight(delta_days=-7),