Self hosted FLOSS fitness/workout, nutrition and weight tracker
Convert floats to string before converting to decimal...
Roland Geider18f15e3281b2
diff --git a/wger/manager/models.py b/wger/manager/models.pyindex 7dff903ce..9d8ba62ee 100644--- a/wger/manager/models.py+++ b/wger/manager/models.py@@ -725,7 +725,7 @@ by the US Department of Agriculture. It is extremely complete, with around# Any of the entries is missingrate = 0- return decimal.Decimal(rate).quantize(decimal.Decimal('.01'))+ return decimal.Decimal(str(rate)).quantize(decimal.Decimal('.01'))def calculate_activities(self):'''@@ -767,7 +767,7 @@ by the US Department of Agriculture. It is extremely complete, with around# Totaltotal = (sleep + work + sport + freetime) / 24.0- return decimal.Decimal(total).quantize(decimal.Decimal('.01'))+ return decimal.Decimal(str(total)).quantize(decimal.Decimal('.01'))# Every new user gets a profile