diff --git a/backend/apps/user_notifications/management/commands/send_notification.py b/backend/apps/user_notifications/management/commands/send_notification.py index 8beba3a4..390de5dc 100644 --- a/backend/apps/user_notifications/management/commands/send_notification.py +++ b/backend/apps/user_notifications/management/commands/send_notification.py @@ -17,7 +17,7 @@ def check_for_updates(subscription: TableUpdateSubscription) -> TableUpdateSubsc if subscription.updated_at < table.last_updated_at: return subscription - return subscription + return False def send_update_notification_email(user: Account, subscriptions: list, date_today: dj_timezone): diff --git a/backend/apps/user_notifications/tasks.py b/backend/apps/user_notifications/tasks.py index d4ac8570..99d5ca66 100644 --- a/backend/apps/user_notifications/tasks.py +++ b/backend/apps/user_notifications/tasks.py @@ -3,7 +3,10 @@ from huey import crontab from huey.contrib.djhuey import db_periodic_task +from backend.custom.environment import production_task + @db_periodic_task(crontab(day_of_week="1-5", hour="7", minute="0")) +@production_task def check_for_updates_and_send_emails(): call_command("send_notification")