fix: EditDrawer correctly reads and labels unlisted privacy
- serve/server.py GET adds private:bool to the response (true when privacy is "unlisted" or legacy "private") so EditDrawer can read it - edit/server.py GET: same fix for the single-user edit server - EditDrawer: fall back to d.privacy if d.private is absent; rename "Private" toggle label to "Unlisted"
This commit is contained in:
@@ -1236,7 +1236,11 @@ async def get_activity(
|
||||
user = _require_user(bincio_session)
|
||||
_check_id(activity_id)
|
||||
path = _require_owns(activity_id, user)
|
||||
return JSONResponse(json.loads(path.read_text()))
|
||||
detail = json.loads(path.read_text())
|
||||
# Normalise for EditDrawer: add `private` bool so the drawer works regardless
|
||||
# of whether the raw JSON uses the old "private" or the new "unlisted" value.
|
||||
detail["private"] = detail.get("privacy") in ("private", "unlisted")
|
||||
return JSONResponse(detail)
|
||||
|
||||
|
||||
@app.post("/api/activity/{activity_id}", response_model=ActivityEditResponse)
|
||||
|
||||
Reference in New Issue
Block a user