feat(api): ignore weekly report if SMTP not configured

This commit is contained in:
Taha Yassine Kraiem 2022-06-10 11:53:47 +02:00
parent 8aec595495
commit 119ecd7743

View file

@ -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),