fix: add active check post account platform update to prevent silent ignore by remote backend
This commit is contained in:
@@ -1825,6 +1825,16 @@ def organize_website_groups(
|
||||
if "group_ids" in update_payload:
|
||||
remote_acc["group_ids"] = new_group_ids
|
||||
if "platform" in update_payload:
|
||||
# 主动核对防线:防止子站忽略 platform 修改而发生静默失败
|
||||
fresh_accs = c.list_accounts() or []
|
||||
fresh_acc = next((a for a in fresh_accs if str(c.extract_id(a)) == str(old_account_id)), None)
|
||||
if fresh_acc:
|
||||
remote_account_map[str(old_account_id)] = fresh_acc
|
||||
new_platform = fresh_acc.get("platform")
|
||||
if str(new_platform).lower() != str(platform).lower():
|
||||
raise WebsiteError(
|
||||
f"远端账号不支持修改平台属性,尝试将平台从 {remote_platform} 修改为 {platform} 失败"
|
||||
)
|
||||
remote_acc["platform"] = platform
|
||||
|
||||
msg_parts = []
|
||||
|
||||
Reference in New Issue
Block a user