From 1e2c656dcc077a1443ce168d9e1c6cd7ff00902f Mon Sep 17 00:00:00 2001 From: Luiz Eduardo Date: Wed, 14 Jan 2026 17:44:21 -0300 Subject: [PATCH] check_for_updates_and_send_emails only production --- .../management/commands/send_notification.py | 2 +- backend/apps/user_notifications/tasks.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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")