deliver: 交付收口(引擎代为提交)
This commit is contained in:
parent
82e5e1d9f2
commit
b1066463e7
@ -87,12 +87,13 @@ def build_audit_record(action, table=None, row_id=None, detail=None, ctx=None,
|
||||
tenant_id=None, actor_id=None, actor_type=None,
|
||||
trace_id=None, result='ok', created_at=None):
|
||||
"""构造一条审计记录 dict(tenant_id 打头,不落库)。"""
|
||||
tid = normalize_tenant(tenant_id if tenant_id is not None else _safe_tenant(ctx))
|
||||
if not tid:
|
||||
raw_tid = tenant_id if tenant_id is not None else _safe_tenant(ctx)
|
||||
if raw_tid is None or str(raw_tid).strip() == '':
|
||||
raise ParamInvalidError(
|
||||
code=PBL_E_TENANT_MISSING,
|
||||
message='审计写入缺少 tenant_id(审计同样强制租户打头)',
|
||||
detail={'action': action, 'table': table})
|
||||
tid = normalize_tenant(raw_tid)
|
||||
if ctx is None:
|
||||
try:
|
||||
ctx_obj = current_context(strict=False)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user