fix: 无钉钉凭据时明确报失败让业务降级人工——防mock实例无人可审导致审批永久卡死
This commit is contained in:
parent
d10401d3c3
commit
047d54a204
@ -185,6 +185,14 @@ async def submit_approval(biz_type, biz_id, title, applicant_id, org_id='0'):
|
|||||||
"""
|
"""
|
||||||
client = get_dingtalk_client()
|
client = get_dingtalk_client()
|
||||||
|
|
||||||
|
# 无钉钉凭据(未对接):明确报失败让调用方降级人工审批。
|
||||||
|
# ⚠️ 不能返回 mock 成功——假实例无人可审,回调永不到达,审批会永久卡死。
|
||||||
|
if client.is_dev_mode:
|
||||||
|
logger.warning('DingTalk credentials not configured, biz_type=%s '
|
||||||
|
'should fall back to human approval', biz_type)
|
||||||
|
return {'success': False,
|
||||||
|
'message': 'DingTalk not configured (missing DINGTALK_APP_KEY/SECRET)'}
|
||||||
|
|
||||||
# 查找审批配置
|
# 查找审批配置
|
||||||
config = await get_approval_config_by_type(org_id, biz_type)
|
config = await get_approval_config_by_type(org_id, biz_type)
|
||||||
if not config:
|
if not config:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user