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.
This commit is contained in:
parent
ce66513488
commit
7d6eb8a27a
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue