From 0ed0ac9ea7f1949f4655f524fcc10e44c3d4c400 Mon Sep 17 00:00:00 2001 From: Son Nguyen Kim Date: Thu, 23 Sep 2021 09:19:07 +0200 Subject: [PATCH] handle "text/x-python-script" in replace() --- app/email_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/email_utils.py b/app/email_utils.py index ad7f99f0..1d7c85ee 100644 --- a/app/email_utils.py +++ b/app/email_utils.py @@ -931,6 +931,7 @@ def replace(msg: Message, old, new) -> Message: or content_type == "text/calendar" or content_type == "text/directory" or content_type == "text/csv" + or content_type == "text/x-python-script" ): LOG.d("not applicable for %s", content_type) return msg @@ -959,7 +960,7 @@ def replace(msg: Message, old, new) -> Message: clone_msg.set_payload(new_parts) return clone_msg - LOG.e("Cannot replace text for %s", msg.get_content_type()) + LOG.w("Cannot replace text for %s", msg.get_content_type()) return msg