Skip to content

Commit fc2a678

Browse files
committed
Resolve more type checking issues
1 parent d907449 commit fc2a678

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# Warn users if they have missing required environment variables
2020
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:
2222
if key in os.environ:
2323
return os.environ[key]
2424
elif required:

src/login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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: ")

src/totp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ def get_token(secret: str) -> str:
1818

1919
if __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")

0 commit comments

Comments
 (0)