fix: circ_summary now checks all 8 circumference points
All checks were successful
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s

- Previously only checked c_chest, c_waist, c_hip
- Now includes c_neck, c_belly, c_thigh, c_calf, c_arm
- Fixes 'keine Daten' when entries exist with only non-primary measurements
This commit is contained in:
Lars 2026-03-26 13:06:37 +01:00
parent b0f80e0be7
commit d06d3d84de

View File

@ -127,7 +127,8 @@ def get_circ_summary(profile_id: str) -> str:
with get_db() as conn: with get_db() as conn:
cur = get_cursor(conn) cur = get_cursor(conn)
cur.execute( cur.execute(
"""SELECT c_chest, c_waist, c_hip, date FROM circumference_log """SELECT c_neck, c_chest, c_waist, c_belly, c_hip, c_thigh, c_calf, c_arm, date
FROM circumference_log
WHERE profile_id=%s WHERE profile_id=%s
ORDER BY date DESC LIMIT 1""", ORDER BY date DESC LIMIT 1""",
(profile_id,) (profile_id,)
@ -137,10 +138,16 @@ def get_circ_summary(profile_id: str) -> str:
if not row: if not row:
return "keine Umfangsmessungen" return "keine Umfangsmessungen"
# Check all 8 circumference points
parts = [] parts = []
if row.get('c_neck'): parts.append(f"Nacken {row['c_neck']:.1f}cm")
if row.get('c_chest'): parts.append(f"Brust {row['c_chest']:.1f}cm") if row.get('c_chest'): parts.append(f"Brust {row['c_chest']:.1f}cm")
if row.get('c_waist'): parts.append(f"Taille {row['c_waist']:.1f}cm") if row.get('c_waist'): parts.append(f"Taille {row['c_waist']:.1f}cm")
if row.get('c_belly'): parts.append(f"Bauch {row['c_belly']:.1f}cm")
if row.get('c_hip'): parts.append(f"Hüfte {row['c_hip']:.1f}cm") if row.get('c_hip'): parts.append(f"Hüfte {row['c_hip']:.1f}cm")
if row.get('c_thigh'): parts.append(f"Oberschenkel {row['c_thigh']:.1f}cm")
if row.get('c_calf'): parts.append(f"Wade {row['c_calf']:.1f}cm")
if row.get('c_arm'): parts.append(f"Arm {row['c_arm']:.1f}cm")
return f"{', '.join(parts)} ({row['date']})" if parts else "keine Daten" return f"{', '.join(parts)} ({row['date']})" if parts else "keine Daten"