From d9e767f87d1719979deca9ade66631c5c13e7288 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 27 May 2024 12:31:48 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=96=B0=E5=A2=9E=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/endpoints/message.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/api/endpoints/message.py b/app/api/endpoints/message.py index a25b0cbe..11ad51c4 100644 --- a/app/api/endpoints/message.py +++ b/app/api/endpoints/message.py @@ -134,6 +134,11 @@ def read_switchs(_: schemas.TokenPayload = Depends(verify_token)) -> Any: else: for switch in switchs: return_list.append(NotificationSwitch(**switch)) + for noti in NotificationType: + if not any([x.mtype == noti.value for x in return_list]): + return_list.append(NotificationSwitch(mtype=noti.value, wechat=True, + telegram=True, slack=True, + synologychat=True, vocechat=True)) return return_list