fix: null subject when non-Debug mode
This commit is contained in:
parent
a9c3e63b44
commit
65beca5067
2
main.py
2
main.py
@ -194,7 +194,7 @@ def mail_notify(violators: list) -> None:
|
||||
print(f' {username} {usage_msg}')
|
||||
msg = MAIL_MESSAGE.format(username, usage_msg)
|
||||
msg = MIMEText(msg, 'html') # 郵件內文
|
||||
msg['Subject'] = f'[網管通知] 提醒您已經超過 CMLab GPU 使用限制!({username})' + "(DEBUG MODE)" if DEBUG_MODE else ""
|
||||
msg['Subject'] = f'[網管通知] 提醒您已經超過 CMLab GPU 使用限制!({username})'
|
||||
msg['From'] = 'unix_manager@cmlab.csie.ntu.edu.tw'
|
||||
msg['To'] = f'{username}@cmlab.csie.ntu.edu.tw' if not DEBUG_MODE else 'snsd0805@cmlab.csie.ntu.edu.tw'
|
||||
msg['Cc'] = 'unix_manager@cmlab.csie.ntu.edu.tw' if not DEBUG_MODE else 'snsd0805@cmlab.csie.ntu.edu.tw'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user