From 2db27b48d10aa409f2c755a12f35a9465afa3f46 Mon Sep 17 00:00:00 2001 From: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Date: Fri, 17 Mar 2023 10:05:55 -0400 Subject: [PATCH] Got things working (#4510) --- openbb_terminal/forex/oanda/oanda_model.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openbb_terminal/forex/oanda/oanda_model.py b/openbb_terminal/forex/oanda/oanda_model.py index 7b80e6dc507..91ddcd10314 100644 --- a/openbb_terminal/forex/oanda/oanda_model.py +++ b/openbb_terminal/forex/oanda/oanda_model.py @@ -28,10 +28,13 @@ logger = logging.getLogger(__name__) current_user = get_current_user() if current_user.credentials.OANDA_ACCOUNT_TYPE != "REPLACE_ME": - client = API( - access_token=current_user.credentials.OANDA_TOKEN, - environment=current_user.credentials.OANDA_ACCOUNT_TYPE, - ) + try: + client = API( + access_token=current_user.credentials.OANDA_TOKEN, + environment=current_user.credentials.OANDA_ACCOUNT_TYPE, + ) + except KeyError: + client = None else: client = None account = current_user.credentials.OANDA_ACCOUNT