fix: trade_policy 宏使用 with context 修复 500

Jinja imported macros did not receive trade_policy from render context, causing Internal Server Error on all instance pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-05 00:36:06 +08:00
parent c0ad50a7b5
commit efe7a57e60
9 changed files with 46 additions and 8 deletions
@@ -142,7 +142,7 @@
{% endif %}
</div>
<form id="key-form" action="/add_key" method="post" class="form-row">
{% from 'trade_policy_fields.html' import trade_policy_symbol, trade_policy_direction %}
{% from 'trade_policy_fields.html' import trade_policy_symbol, trade_policy_direction with context %}
{{ trade_policy_symbol('symbol', 'key-symbol') }}
<select name="type" id="key-type-select" required>
{% if position_sizing_mode != 'full_margin' %}