diff --git a/cron.py b/cron.py index dd61bbad..7962c45b 100644 --- a/cron.py +++ b/cron.py @@ -19,7 +19,9 @@ from server import create_app def notify_trial_end(): - for user in User.query.filter(User.trial_end.isnot(None)).all(): + for user in User.query.filter( + User.activated == True, User.trial_end.isnot(None) + ).all(): if arrow.now().shift(days=3) > user.trial_end >= arrow.now().shift(days=2): LOG.d("Send trial end email to user %s", user) send_trial_end_soon_email(user) diff --git a/job_runner.py b/job_runner.py index 0c412112..be099941 100644 --- a/job_runner.py +++ b/job_runner.py @@ -37,6 +37,10 @@ def new_app(): def onboarding_1(user): + if not user.activated: + LOG.d("User %s is not activated", user) + return + if not user.notification: LOG.d("User %s disable notification setting", user) return