From 82b7ad98a323e7732c5b3182a5298213837c5d1d Mon Sep 17 00:00:00 2001 From: Haresh Kainth Date: Fri, 6 Dec 2024 23:58:41 +0000 Subject: [PATCH] chore:Remove deprecated pytz usage and setup Django in Celery. This commit removes the USE_DEPRECATED_PYTZ setting from local.py as it is no longer necessary. Additionally, it ensures Django is properly set up in the Celery configuration, which may prevent potential issues with accessing Django models or settings within Celery tasks. --- fbr/config/celery.py | 3 +++ fbr/config/settings/local.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fbr/config/celery.py b/fbr/config/celery.py index 62cbdf3..fd3f573 100644 --- a/fbr/config/celery.py +++ b/fbr/config/celery.py @@ -4,7 +4,10 @@ from celery.schedules import crontab from dbt_copilot_python.celery_health_check import healthcheck +import django + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") +django.setup() celery_app = Celery("fbr_celery") diff --git a/fbr/config/settings/local.py b/fbr/config/settings/local.py index 5576918..97c194f 100644 --- a/fbr/config/settings/local.py +++ b/fbr/config/settings/local.py @@ -9,6 +9,4 @@ "cache", ] -USE_DEPRECATED_PYTZ = True - INSTALLED_APPS = BASE_APPS + INSTALLED_APPS # noqa