diff --git a/settings.py b/settings.py index 504fe8c..4f04601 100644 --- a/settings.py +++ b/settings.py @@ -3,6 +3,7 @@ import configparser import json import os +import sys config = configparser.ConfigParser() config['pomodoro'] = {} @@ -47,4 +48,7 @@ def harvest_set_projects_clients_map(projects_clients_map = {}): write() def harvest_get_projects_clients_map(): - return json.loads(harvest['projects_clients']) + if 'projects_clients' in harvest: + return json.loads(harvest['projects_clients']) + else: + sys.exit("No project clients available; run fetch_clients_projects.py")