forked from erp-dev/erp
feat: fix setting
This commit is contained in:
@@ -326,15 +326,13 @@ def on_printing_order_created(sender, **kwargs):
|
||||
except Exception:
|
||||
logger.exception("[printing.handlers] 发送 WeCom webhook 失败(已忽略,不影响主流程)")
|
||||
|
||||
# Just for testing
|
||||
# ==============================================================
|
||||
try:
|
||||
from flower.utils import play_speech
|
||||
if getattr(settings, "PRINTING_ORDER_CREATED_SPEECH_ENABLED", False):
|
||||
try:
|
||||
from flower.utils import play_speech
|
||||
|
||||
play_speech(text=f"生产订单 {order_id} 已创建")
|
||||
except Exception:
|
||||
logger.exception("[printing.handlers] 发送语音播报失败(已忽略,不影响主流程)")
|
||||
# ===================================
|
||||
play_speech(text=f"生产订单 {order_id} 已创建")
|
||||
except Exception:
|
||||
logger.exception("[printing.handlers] 发送语音播报失败(已忽略,不影响主流程)")
|
||||
|
||||
# 在事务提交后再发送,避免事务回滚但通知已发出
|
||||
transaction.on_commit(_send_wecom)
|
||||
|
||||
Reference in New Issue
Block a user