Hide synthetic dedupe/reconcile rows from trade list count.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-21 20:11:19 +08:00
parent dcef9f1d61
commit 94d7557b1c
3 changed files with 28 additions and 4 deletions
+9 -1
View File
@@ -907,7 +907,14 @@ def register_routes(app: Flask) -> None:
account_id = None if u["role"] == "admin" else u.get("account_id")
machines, machine_id = _resolve_machine_filter(u, machine_raw)
with database.get_db() as conn:
total = database.count_trades(conn, account_id=account_id, machine_id=machine_id)
database.scrub_synthetic_trade_profits(conn)
database.scrub_duplicate_ticket_profits(conn)
total = database.count_trades(
conn,
account_id=account_id,
machine_id=machine_id,
hide_synthetic=True,
)
total_pages = max(1, (total + per_page - 1) // per_page)
if page > total_pages:
page = total_pages
@@ -918,6 +925,7 @@ def register_routes(app: Flask) -> None:
account_id=account_id,
machine_id=machine_id,
offset=offset,
hide_synthetic=True,
)
for t in trades:
_annotate_trade_times(t)