refactor(routines): use category and short uuid for recent history representation
This commit is contained in:
parent
28fb74b9bf
commit
0e7a39836f
1 changed files with 6 additions and 2 deletions
|
|
@ -259,9 +259,13 @@ def _build_recent_history(session: Session) -> str:
|
|||
for s in steps:
|
||||
if s.product_id:
|
||||
p = session.get(Product, s.product_id)
|
||||
step_names.append(p.name if p else str(s.product_id))
|
||||
if p:
|
||||
short_id = str(p.id)[:8]
|
||||
step_names.append(f"{_ev(p.category)} [{short_id}]")
|
||||
else:
|
||||
step_names.append(f"unknown [{str(s.product_id)[:8]}]")
|
||||
elif s.action_type:
|
||||
step_names.append(_ev(s.action_type))
|
||||
step_names.append(f"action: {_ev(s.action_type)}")
|
||||
lines.append(
|
||||
f" {r.routine_date} {_ev(r.part_of_day).upper()}: {', '.join(step_names)}"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue