fix: convert Decimal to float before multiplication in protein targets
All checks were successful
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s

- get_protein_ziel_low: float(weight) * 1.6
- get_protein_ziel_high: float(weight) * 2.2

Fixes TypeError: unsupported operand type(s) for *: 'decimal.Decimal' and 'float'

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-03-26 09:23:50 +01:00
parent b90c738fbb
commit 811ba8b3dc

View File

@ -184,7 +184,7 @@ def get_protein_ziel_low(profile_id: str) -> str:
)
row = cur.fetchone()
if row:
return f"{int(row['weight'] * 1.6)}"
return f"{int(float(row['weight']) * 1.6)}"
return "nicht verfügbar"
@ -199,7 +199,7 @@ def get_protein_ziel_high(profile_id: str) -> str:
)
row = cur.fetchone()
if row:
return f"{int(row['weight'] * 2.2)}"
return f"{int(float(row['weight']) * 2.2)}"
return "nicht verfügbar"