fix: 500 error on /pages/{id} — missing page_share_mode in dashboard.py
dashboard.router is registered before board.router in main.py, so its
/pages/{page_id} takes priority. It was missing page_share_mode and
page_published template variables, causing Jinja2 TypeError.
This commit is contained in:
@@ -166,7 +166,10 @@ async def view_page_root(request: Request, page_id: int):
|
|||||||
"SELECT id, title FROM pages WHERE parent_id=? ORDER BY updated_at DESC",
|
"SELECT id, title FROM pages WHERE parent_id=? ORDER BY updated_at DESC",
|
||||||
(page_id,),
|
(page_id,),
|
||||||
).fetchall()
|
).fetchall()
|
||||||
ctx = {**sidebar, "page": page, "sub_pages": [dict(s) for s in subs], "page_favorited": False}
|
ctx = {**sidebar, "page": page, "sub_pages": [dict(s) for s in subs],
|
||||||
|
"page_favorited": False,
|
||||||
|
"page_share_mode": page.get("share_mode", "private"),
|
||||||
|
"page_published": bool(page.get("published", 0))}
|
||||||
template = env.get_template("page_editor.html")
|
template = env.get_template("page_editor.html")
|
||||||
return template.render(**ctx)
|
return template.render(**ctx)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user