Adjusted some API endpoint
Some checks failed
Qodana / qodana (push) Has been cancelled

This commit is contained in:
Donald Zou
2025-04-19 02:54:47 +08:00
parent 66f4507dee
commit 6681303450
48 changed files with 191 additions and 156 deletions

View File

@@ -51,10 +51,10 @@ class EmailSender:
message.attach(MIMEText(body, "plain"))
if includeAttachment and len(attachmentName) > 0:
attachmentPath = os.path.join('../attachments', attachmentName)
attachmentPath = os.path.join('./attachments', attachmentName)
if os.path.exists(attachmentPath):
attachment = MIMEBase("application", "octet-stream")
with open(os.path.join('../attachments', attachmentName), 'rb') as f:
with open(os.path.join('./attachments', attachmentName), 'rb') as f:
attachment.set_payload(f.read())
encoders.encode_base64(attachment)
attachment.add_header("Content-Disposition", f"attachment; filename= {attachmentName}",)