mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
ignore unicode characters errors
+ add methods on settings.Keys to verify key !== empty string
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user