From 692b69dcd256032574ab7dc8babf939f31c3a636 Mon Sep 17 00:00:00 2001 From: guohelu <141622458+guohelu@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:23:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E9=97=AE=E9=A2=98=20#7545=20(#7617)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复环境变量问题 #7545 * fix: 修正环境变量 #7545 * fix: 删除多余导包 #7545 * fix: 修改环境变量读取 #7545 --- config/default.py | 3 +++ env.py | 3 +++ gcloud/shortcuts/message/send_msg.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/default.py b/config/default.py index 6b50c6683..cfde7dba3 100644 --- a/config/default.py +++ b/config/default.py @@ -888,3 +888,6 @@ def check_engine_admin_permission(request, *args, **kwargs): ENABLE_BK_CHAT_CHANNEL = env.ENABLE_BK_CHAT_CHANNEL # bk_chat路由 BK_CHAT_API_ENTRY = env.BK_CHAT_API_ENTRY +# bk_chat通知渠道过滤app +BK_CHAT_APP_CODE = env.BK_CHAT_APP_CODE +BK_CHAT_APP_SECRET_KEY = env.BK_CHAT_APP_SECRET_KEY diff --git a/env.py b/env.py index a6553f09a..30a10047d 100644 --- a/env.py +++ b/env.py @@ -158,3 +158,6 @@ ENABLE_BK_CHAT_CHANNEL = False if os.getenv("BKAPP_ENABLE_BK_CHAT_CHANNEL") is None else True # bk_chat通知路由 BK_CHAT_API_ENTRY = os.getenv("BK_CHAT_API_ENTRY", "") +# bk_chat通知渠道过滤app +BK_CHAT_APP_CODE = os.getenv("BK_CHAT_APP_CODE", os.getenv("BKPAAS_APP_ID")) +BK_CHAT_APP_SECRET_KEY = os.getenv("BK_CHAT_APP_SECRET_KEY", os.getenv("BKPAAS_APP_SECRET")) diff --git a/gcloud/shortcuts/message/send_msg.py b/gcloud/shortcuts/message/send_msg.py index f462019b0..b09f2b6ad 100644 --- a/gcloud/shortcuts/message/send_msg.py +++ b/gcloud/shortcuts/message/send_msg.py @@ -67,7 +67,7 @@ def send(self, executor, notify_type, notify_info, receivers, title, content, em return True def send_bkchat(self, notify, content): - params = {"bk_app_code": settings.APP_CODE, "bk_app_secret": settings.SECRET_KEY} + params = {"bk_app_code": settings.BK_CHAT_APP_CODE, "bk_app_secret": settings.BK_CHAT_APP_SECRET_KEY} data = { "im": "WEWORK",