From a452f3307f78bb32aad4a94c68664b1d3f57c7af Mon Sep 17 00:00:00 2001 From: xinwen Date: Thu, 16 Sep 2021 14:28:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=84=E4=BB=B6=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/notifications.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/ops/notifications.py b/apps/ops/notifications.py index a0ed17b94..18cb9bf61 100644 --- a/apps/ops/notifications.py +++ b/apps/ops/notifications.py @@ -17,13 +17,20 @@ class ServerPerformanceMessage(SystemMessage): def __init__(self, msg): self._msg = msg - def get_common_msg(self): + def get_html_msg(self) -> dict: subject = self._msg[:80] return { 'subject': subject.replace('
', '; '), 'message': self._msg } + def get_text_msg(self) -> dict: + subject = self._msg[:80] + return { + 'subject': subject.replace('
', '; '), + 'message': self._msg.replace('
', '\n') + } + @classmethod def post_insert_to_db(cls, subscription: SystemMsgSubscription): admins = User.objects.filter(role=User.ROLE.ADMIN)