ignore unicode characters errors

+ add methods on settings.Keys to verify key !== empty string
This commit is contained in:
mungai-njoroge
2023-09-26 17:59:12 +03:00
parent 5cf0bb8c42
commit 54714a224b
5 changed files with 27 additions and 27 deletions
+13
View File
@@ -6,6 +6,7 @@ import sys
from typing import Any
from app import configs
from app.logger import log
join = os.path.join
@@ -239,3 +240,15 @@ class Keys:
if IS_BUILD:
cls.LASTFM_API = configs.LASTFM_API_KEY
cls.POSTHOG_API_KEY = configs.POSTHOG_API_KEY
cls.verify_exists()
@classmethod
def verify_exists(cls):
if not cls.LASTFM_API:
log.error("ERROR: LASTFM_API_KEY not set in environment")
sys.exit(0)
if not cls.POSTHOG_API_KEY:
log.error("ERROR: POSTHOG_API_KEY not set in environment")
sys.exit(0)