顶栏加固:交易账户/期权字段缺省与币金额格式化吞掉Undefined,降低再发500风险
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -121,7 +121,8 @@ def _fmt_coin_amount(v: float | None, *, min_amt: float = 1e-6) -> str | None:
|
||||
return None
|
||||
try:
|
||||
n = float(v)
|
||||
except (TypeError, ValueError):
|
||||
except Exception:
|
||||
# Jinja Undefined 等也吞掉,避免顶栏 float(Undefined) → HTTP 500
|
||||
return None
|
||||
if n < min_amt:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user