fix: convert Decimal to float before multiplication in protein targets
- 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:
parent
b90c738fbb
commit
811ba8b3dc
|
|
@ -184,7 +184,7 @@ def get_protein_ziel_low(profile_id: str) -> str:
|
||||||
)
|
)
|
||||||
row = cur.fetchone()
|
row = cur.fetchone()
|
||||||
if row:
|
if row:
|
||||||
return f"{int(row['weight'] * 1.6)}"
|
return f"{int(float(row['weight']) * 1.6)}"
|
||||||
return "nicht verfügbar"
|
return "nicht verfügbar"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -199,7 +199,7 @@ def get_protein_ziel_high(profile_id: str) -> str:
|
||||||
)
|
)
|
||||||
row = cur.fetchone()
|
row = cur.fetchone()
|
||||||
if row:
|
if row:
|
||||||
return f"{int(row['weight'] * 2.2)}"
|
return f"{int(float(row['weight']) * 2.2)}"
|
||||||
return "nicht verfügbar"
|
return "nicht verfügbar"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user