From 96c3fe23b0174313d966ddd347467ab48eabee20 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Mon, 5 May 2025 17:16:57 +0300 Subject: [PATCH] Update promotion handling and logging levels Change promotions to inactive instead of deleting them to maintain data integrity. Adjust Celery logging levels to be DEBUG/INFO based on the DEBUG setting, improving log granularity during development and clarity in production. --- core/tasks.py | 2 +- evibes/settings/logconfig.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/tasks.py b/core/tasks.py index bb2a770a..7a28416c 100644 --- a/core/tasks.py +++ b/core/tasks.py @@ -159,7 +159,7 @@ def process_promotions() -> tuple[bool, str]: if not config.ABSTRACT_API_KEY: return False, "Abstract features disabled." - Promotion.objects.all().delete() + Promotion.objects.all().update(is_active=False) holiday_data = None diff --git a/evibes/settings/logconfig.py b/evibes/settings/logconfig.py index be728419..085ed396 100644 --- a/evibes/settings/logconfig.py +++ b/evibes/settings/logconfig.py @@ -73,12 +73,12 @@ LOGGING = { }, "celery.app.trace": { "handlers": ["console_debug" if DEBUG else "console_production"], # noqa: F405 - "level": "ERROR", + "level": "DEBUG" if DEBUG else "INFO", "propagate": False, }, "celery.worker.strategy": { "handlers": ["console_debug" if DEBUG else "console_production"], # noqa: F405 - "level": "ERROR", + "level": "DEBUG" if DEBUG else "INFO", "propagate": False, }, "elastic_transport.transport": {