mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 17:54:15 +08:00
fix(notifications): #244 维护者补丁 — 移除预埋类型并修正全角标点
- 移除 api.ts 中与通知无关的 MainCostEstimate/StockLevels.main_cost 类型(对应后端字段在本仓库不存在, 属跨 PR 预埋, 全仓库零引用) - settings.py 5 处 PR 新增字符串的全角逗号改半角, RUF001 恢复到 main 基线(28 ≤ 29) - 验证: 通知测试 48 passed, 前端 build 通过
This commit is contained in:
@@ -1292,7 +1292,7 @@ def update_email_smtp(req: EmailSmtpPrefsIn) -> dict:
|
||||
else req.password
|
||||
)
|
||||
if username and not effective_password:
|
||||
raise HTTPException(status_code=400, detail="已填写 SMTP 登录用户名,请同时填写密码或授权码")
|
||||
raise HTTPException(status_code=400, detail="已填写 SMTP 登录用户名, 请同时填写密码或授权码")
|
||||
else:
|
||||
username = ""
|
||||
from_address = ""
|
||||
@@ -1353,9 +1353,9 @@ def test_webhook(req: WebhookTestIn) -> dict:
|
||||
elif req.channel == "custom":
|
||||
url = preferences.get_custom_webhook_url()
|
||||
if not url:
|
||||
return {"ok": False, "detail": "尚未配置第三方 Webhook,请先保存"}
|
||||
return {"ok": False, "detail": "尚未配置第三方 Webhook, 请先保存"}
|
||||
if not webhook_adapter.is_valid_custom_url(url):
|
||||
return {"ok": False, "detail": "已保存的第三方 Webhook 地址非法,请重新保存"}
|
||||
return {"ok": False, "detail": "已保存的第三方 Webhook 地址非法, 请重新保存"}
|
||||
ok = webhook_adapter.send_custom(
|
||||
url,
|
||||
title,
|
||||
@@ -1369,7 +1369,7 @@ def test_webhook(req: WebhookTestIn) -> dict:
|
||||
|
||||
config = preferences.get_email_smtp_config()
|
||||
if not email_adapter.is_configured(config):
|
||||
return {"ok": False, "detail": "尚未完整配置邮件 SMTP,请先保存"}
|
||||
return {"ok": False, "detail": "尚未完整配置邮件 SMTP, 请先保存"}
|
||||
ok = email_adapter.send_email(
|
||||
config,
|
||||
secrets_store.get_email_smtp_password(),
|
||||
@@ -1379,7 +1379,7 @@ def test_webhook(req: WebhookTestIn) -> dict:
|
||||
)
|
||||
|
||||
if ok:
|
||||
return {"ok": True, "detail": "测试消息已发送,请检查对应接收端"}
|
||||
return {"ok": True, "detail": "测试消息已发送, 请检查对应接收端"}
|
||||
return {"ok": False, "detail": "推送失败:网络不可达或地址/密钥不正确,详情见后端日志"}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user