File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 18
18
19
19
# Warn users if they have missing required environment variables
20
20
environ_help_url = "https://github.com/Zohair-coder/drexel-scraper?tab=readme-ov-file#authentication"
21
- def get_environ (key : str , required = True ) -> str :
21
+ def get_environ (key : str , required : bool = True ) -> str :
22
22
if key in os .environ :
23
23
return os .environ [key ]
24
24
elif required :
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def login_with_drexel_connect(session: Session) -> Session:
78
78
79
79
parsed_data = parse_final_mfa_page (soup )
80
80
81
- if config .drexel_mfa_secret_key != None :
81
+ if config .drexel_mfa_secret_key is not None :
82
82
mfa_token = totp .get_token (config .drexel_mfa_secret_key )
83
83
else :
84
84
mfa_token = input ("Please input your MFA verification code: " )
Original file line number Diff line number Diff line change @@ -18,4 +18,7 @@ def get_token(secret: str) -> str:
18
18
19
19
if __name__ == "__main__" :
20
20
import config
21
- print (get_token (config .drexel_mfa_secret_key ))
21
+ if config .drexel_mfa_secret_key is not None :
22
+ print (get_token (config .drexel_mfa_secret_key ))
23
+ else :
24
+ print (f"Please set your MFA secret key to run this script. See { config .environ_help_url } for more information and help" )
You can’t perform that action at this time.
0 commit comments