fix: circ_summary now checks all 8 circumference points
- 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:
parent
b0f80e0be7
commit
d06d3d84de
|
|
@ -127,7 +127,8 @@ def get_circ_summary(profile_id: str) -> str:
|
|||
with get_db() as conn:
|
||||
cur = get_cursor(conn)
|
||||
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
|
||||
ORDER BY date DESC LIMIT 1""",
|
||||
(profile_id,)
|
||||
|
|
@ -137,10 +138,16 @@ def get_circ_summary(profile_id: str) -> str:
|
|||
if not row:
|
||||
return "keine Umfangsmessungen"
|
||||
|
||||
# Check all 8 circumference points
|
||||
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_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_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"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user