fix: sqlite3.Row .get() → bracket notation in _load_workspace_pages
Same bug as tree API — sqlite3.Row doesn't implement .get(), only __getitem__ (bracket notation). Fixed icon detection for folders vs files in sidebar workspace section.
This commit is contained in:
@@ -152,7 +152,7 @@ def _load_workspace_pages(ws_cookie: str) -> list:
|
|||||||
(ws_id,),
|
(ws_id,),
|
||||||
).fetchall()
|
).fetchall()
|
||||||
return [{"db_id": r["id"], "name": r["title"] or "Untitled", "id": f"page/{r['id']}",
|
return [{"db_id": r["id"], "name": r["title"] or "Untitled", "id": f"page/{r['id']}",
|
||||||
"icon": "📁" if r.get("parent_section") == "Workspace" else "📄"} for r in rows]
|
"icon": "📁" if r["parent_section"] == "Workspace" else "📄"} for r in rows]
|
||||||
except (ValueError, Exception):
|
except (ValueError, Exception):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user