fix(todos): 待办列表项目列显示名称——孤儿待办(项目已删)兜底显示「(项目已删除)」不再显示裸项目编号(2026-09-15用户指令)

This commit is contained in:
ymq 2026-09-15 16:46:45 +08:00
parent 9d49ccdc14
commit eb49b18597
2 changed files with 3 additions and 3 deletions

View File

@ -21,8 +21,8 @@ for t in todos:
proj_names[pid] = getattr(_pr[0], 'name', '') or pid
except Exception:
pass
t['project_name'] = proj_names.get(pid, pid)
t['project_name'] = proj_names.get(pid) or ('(项目已删除)' if pid else '')
else:
t['project_name'] = proj_names.get(pid, pid)
t['project_name'] = proj_names.get(pid) or ('(项目已删除)' if pid else '')
return json.dumps({"success": True, "todos": todos}, ensure_ascii=False, default=str)

View File

@ -91,7 +91,7 @@ for t in (todos or []):
pid = _s(t.get('project_id'))
meta_bits = []
pname = proj_names.get(pid) or _s(t.get('project_name')) or pid
pname = proj_names.get(pid) or _s(t.get('project_name')) or ('(项目已删除)' if pid else '')
if pname:
meta_bits.append('项目:' + pname)
if t.get('created_at'):