From d06d3d84ded6234c86d1d973b40cb1a8eb47b45e Mon Sep 17 00:00:00 2001 From: Lars Date: Thu, 26 Mar 2026 13:06:37 +0100 Subject: [PATCH] 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 --- backend/placeholder_resolver.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/placeholder_resolver.py b/backend/placeholder_resolver.py index 126929d..e568f4a 100644 --- a/backend/placeholder_resolver.py +++ b/backend/placeholder_resolver.py @@ -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"