From 7d6eb8a27ad93f27f1ca8fe2d244e9ec3bc121d2 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 6 May 2025 17:57:35 +0300 Subject: [PATCH] Refine API key validation in task configuration. Previously, an "example key" could mistakenly pass the check, leading to potential misuse. This update ensures features are disabled if the API key is invalid or set to default. --- core/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tasks.py b/core/tasks.py index 7a28416c..6bf3c5bf 100644 --- a/core/tasks.py +++ b/core/tasks.py @@ -156,7 +156,7 @@ def process_promotions() -> tuple[bool, str]: element is a message describing the operation's outcome. :rtype: tuple[bool, str] """ - if not config.ABSTRACT_API_KEY: + if not config.ABSTRACT_API_KEY or config.ABSTRACT_API_KEY == "example key": return False, "Abstract features disabled." Promotion.objects.all().update(is_active=False)