added check for present api toen and budget id

This commit is contained in:
Jake Pullen
2024-08-10 13:26:02 +01:00
parent fa6332e18a
commit ad633edefd
+3
View File
@@ -13,6 +13,9 @@ dotenv.load_dotenv()
API_TOKEN = os.getenv('API_TOKEN') API_TOKEN = os.getenv('API_TOKEN')
BUDGET_ID = os.getenv('BUDGET_ID') BUDGET_ID = os.getenv('BUDGET_ID')
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
if not API_TOKEN or not BUDGET_ID:
logging.error('API_TOKEN or BUDGET_ID is not set in .env file')
exit(1)
with open('config.yaml', 'r') as file: with open('config.yaml', 'r') as file:
config = yaml.safe_load(file) config = yaml.safe_load(file)