Untitled
unknown
python
3 years ago
495 B
91
Indexable
def check_tokens():
"""Checks the availability of environment variables."""
ENV_VARS = {
'PRACTICUM_TOKEN': PRACTICUM_TOKEN,
'TELEGRAM_TOKEN': TELEGRAM_TOKEN,
'TELEGRAM_CHAT_ID': TELEGRAM_CHAT_ID,
}
missing_vars = [var for var, value in ENV_VARS.items() if not value]
if missing_vars:
logging.critical(
f'Required environment variables are missing: '
f'{", ".join(missing_vars)}'
)
else:
return TrueEditor is loading...