chore: final Minor polish — export filename/test断言, downloadBlob 类型/清理, plan docs
address review Minors: drop redundant filename replace, assert 暂无消息, tighten downloadBlob return type + try/finally, fix plan group time-picker wording. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -87,7 +87,7 @@ async def export_chat_html(
|
||||
q = q.order_by(sa.nullslast(Message.timestamp.asc()), Message.msg_id.asc())
|
||||
rows = (await session.execute(q)).scalars().all()
|
||||
html = _render_chat_html(list(rows), channel, owner_account_id, peer)
|
||||
safe = peer.replace("@", "_").replace("/", "_") or "all"
|
||||
safe = peer or "all"
|
||||
filename = f"chat-{channel}-{owner_account_id}-{safe}.html".replace("@", "_").replace("/", "_")
|
||||
return Response(
|
||||
content=html,
|
||||
|
||||
@@ -57,3 +57,4 @@ async def test_export_empty(make_client):
|
||||
"channel": "wechat", "owner_account_id": "wx_owner", "talker_id": "none"})
|
||||
assert r.status_code == 200
|
||||
assert r.headers["content-type"].startswith("text/html")
|
||||
assert "暂无消息" in r.text
|
||||
|
||||
Reference in New Issue
Block a user