From a78991825d9bbc9b8c112ca273f7edebcf60ce42 Mon Sep 17 00:00:00 2001 From: s-rajaraman Date: Mon, 31 Dec 2018 12:22:29 -0600 Subject: [PATCH] checks if mfa_code is already defined (#40) --- csv-export.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/csv-export.py b/csv-export.py index 61cddf2..ca4dba0 100644 --- a/csv-export.py +++ b/csv-export.py @@ -51,7 +51,10 @@ logged_in = robinhood.login(username=username, password=password) if logged_in != True and logged_in.get('non_field_errors') == None and logged_in['mfa_required'] == True: - mfa_code = os.getenv("RH_MFA") + + if mfa_code is None: + mfa_code = os.getenv("RH_MFA") + if mfa_code == "": print("Robinhood MFA:", end=' ') try: