fix(pl): sync stop dibang on arrange even when all unchecked.
Ensure cancel/block paths run when every generateDibang option is false. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
de95549644
commit
ca4a5b9fec
2 files changed
+12
-3
No files matched your search
@@ -977,9 +977,8 @@ def arrange_transport(
|
||||
and plan.plan_type in ("inbound", "outbound")
|
||||
and payload.generate_dibang_plan
|
||||
)
|
||||
should_sync_stop_dibang = use_multi_stop_dibang and any(
|
||||
item.generate_dibang for item in stop_dibang_options
|
||||
)
|
||||
# 有 stop 选项即同步:全 false 也要进 upsert,才能取消勾选 / 已过磅阻断
|
||||
should_sync_stop_dibang = use_multi_stop_dibang and bool(stop_dibang_options)
|
||||
|
||||
if should_sync_stop_dibang or should_sync_legacy_dibang:
|
||||
try:
|
||||
|
||||
@@ -647,3 +647,13 @@ def test_arrange_transport_source_has_no_revoke_call():
|
||||
|
||||
src = inspect.getsource(transport_api.arrange_transport)
|
||||
assert "revoke_regeneratable_dibang_for_transport" not in src
|
||||
|
||||
|
||||
def test_arrange_transport_syncs_stop_dibang_even_when_all_unchecked():
|
||||
"""全部取消勾选时仍应进入按段 sync,以便取消/已过磅阻断生效。"""
|
||||
import inspect
|
||||
from app.api.pl import transport as transport_api
|
||||
|
||||
src = inspect.getsource(transport_api.arrange_transport)
|
||||
assert "bool(stop_dibang_options)" in src
|
||||
assert "item.generate_dibang for item in stop_dibang_options" not in src
|
||||
Reference in new issue
Block a user