fix(todos): 待办列表项目列显示名称——孤儿待办(项目已删)兜底显示「(项目已删除)」不再显示裸项目编号(2026-09-15用户指令)
This commit is contained in:
parent
9d49ccdc14
commit
eb49b18597
@ -21,8 +21,8 @@ for t in todos:
|
|||||||
proj_names[pid] = getattr(_pr[0], 'name', '') or pid
|
proj_names[pid] = getattr(_pr[0], 'name', '') or pid
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
t['project_name'] = proj_names.get(pid, pid)
|
t['project_name'] = proj_names.get(pid) or ('(项目已删除)' if pid else '')
|
||||||
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)
|
return json.dumps({"success": True, "todos": todos}, ensure_ascii=False, default=str)
|
||||||
|
|||||||
@ -91,7 +91,7 @@ for t in (todos or []):
|
|||||||
|
|
||||||
pid = _s(t.get('project_id'))
|
pid = _s(t.get('project_id'))
|
||||||
meta_bits = []
|
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:
|
if pname:
|
||||||
meta_bits.append('项目:' + pname)
|
meta_bits.append('项目:' + pname)
|
||||||
if t.get('created_at'):
|
if t.get('created_at'):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user