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 1818
1919# Warn users if they have missing required environment variables
2020environ_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 :
2222 if key in os .environ :
2323 return os .environ [key ]
2424 elif required :
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def login_with_drexel_connect(session: Session) -> Session:
7878
7979 parsed_data = parse_final_mfa_page (soup )
8080
81- if config .drexel_mfa_secret_key != None :
81+ if config .drexel_mfa_secret_key is not None :
8282 mfa_token = totp .get_token (config .drexel_mfa_secret_key )
8383 else :
8484 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:
1818
1919if __name__ == "__main__" :
2020 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