修复币本位顶栏改动导致 Gate/Binance 顶栏 UndefinedError 500

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-20 14:56:30 +08:00
parent 87910ed71a
commit b0c331aa26
5 changed files with 22 additions and 8 deletions
+9
View File
@@ -220,10 +220,19 @@ def pwa_app_name(exchange_key: str) -> str:
def embed_context_extras(exchange_key: str) -> dict:
# 顶栏共享模板调用 trading_account_label / options_funding_label;
# 须注入三所,否则 Gate/Binance 渲染会 UndefinedError → HTTP 500.
from lib.instance.instance_embed_context_lib import (
options_funding_label,
trading_account_label,
)
return {
"order_rule_tips_tpl": order_rule_tips_template(exchange_key),
"include_transfer_block": include_transfer_block(exchange_key),
"ui_open_guard_enabled": ui_open_guard_enabled(exchange_key),
"ui_orphan_recovery_enabled": ui_orphan_recovery_enabled(exchange_key),
"pwa_app_name": pwa_app_name(exchange_key),
"options_funding_label": options_funding_label,
"trading_account_label": trading_account_label,
}