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:
1 parent
b90c738fbb
commit
811ba8b3dc
1 file changed
+2
-2
@@ -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"
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user