Allows users to hide their check-ins from other users

This commit is contained in:
Peter Stockings
2026-02-24 13:17:09 +11:00
parent d6885a8339
commit c21a7890f3
9 changed files with 267 additions and 51 deletions

View File

@@ -22,14 +22,15 @@ def update():
gender = request.form.get("gender") or None
goal_weight_kg = request.form.get("goal_weight_kg") or None
starting_weight_kg = request.form.get("starting_weight_kg") or None
is_private = request.form.get("is_private") == "on"
execute(
"""UPDATE users
SET display_name = %s, height_cm = %s, age = %s, gender = %s,
goal_weight_kg = %s, starting_weight_kg = %s
goal_weight_kg = %s, starting_weight_kg = %s, is_private = %s
WHERE id = %s""",
(display_name or user["username"], height_cm, age, gender,
goal_weight_kg, starting_weight_kg, user["id"]),
goal_weight_kg, starting_weight_kg, is_private, user["id"]),
)
if request.headers.get("HX-Request"):