From 65beca5067ec103e331b43bbdaee45b7f71aeaf4 Mon Sep 17 00:00:00 2001 From: Ting-Jun Wang Date: Fri, 22 Mar 2024 19:58:05 +0800 Subject: [PATCH] fix: null subject when non-Debug mode --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 183fb50..12993f6 100644 --- a/main.py +++ b/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'