From 2069fee79553417368402230a2d43d8afa691932 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 27 Sep 2023 10:31:44 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=8F=91=E9=80=81?= =?UTF-8?q?=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/common/tasks.py b/apps/common/tasks.py index a7d9aacdd..2daa5acb5 100644 --- a/apps/common/tasks.py +++ b/apps/common/tasks.py @@ -36,7 +36,9 @@ def send_mail_async(*args, **kwargs): args[0] = (settings.EMAIL_SUBJECT_PREFIX or '') + args[0] from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER args.insert(2, from_email) - args = tuple(args) + + args[3] = [mail for mail in args[3] if mail != 'admin@mycomany.com'] + args = tuple(args) try: return send_mail(*args, **kwargs) @@ -50,6 +52,7 @@ def send_mail_attachment_async(subject, message, recipient_list, attachment_list attachment_list = [] from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER subject = (settings.EMAIL_SUBJECT_PREFIX or '') + subject + recipient_list = [mail for mail in recipient_list if mail != 'admin@mycomany.com'] email = EmailMultiAlternatives( subject=subject, body=message,