feat(profiles): add private notes field per profile, visible only to owner

This commit is contained in:
2026-07-06 19:36:29 +08:00
parent a19f6ccac9
commit 2989837b7d
3 files changed
+19 -1

No files matched your search

+9
View File
@@ -451,6 +451,15 @@ def profile_rename(profile_id: int, nickname: str = Form(...), user: User = Depe
return _redirect("/profiles")
@router.post("/profiles/{profile_id}/notes")
def profile_notes(profile_id: int, notes: str = Form(""), user: User = Depends(get_current_user_web), db: Session = Depends(get_db)):
p = db.query(Profile).filter(Profile.id == profile_id, Profile.user_id == user.id).first()
if p:
p.notes = notes
db.commit()
return _redirect("/profiles")
# ---------- Postcards ----------
@router.get("/profiles/{profile_id}/postcards", response_class=HTMLResponse)