From 948cc7cf17e32fc79ac7980ca42fb7abb883a5b8 Mon Sep 17 00:00:00 2001 From: Gregory Trullemans Date: Tue, 21 Nov 2023 09:17:18 +0100 Subject: [PATCH] fix BMI --- jarvis/followup/models.py | 1 + jarvis/followup/templates/heightweight/list.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jarvis/followup/models.py b/jarvis/followup/models.py index 6533ce6..f35b31c 100644 --- a/jarvis/followup/models.py +++ b/jarvis/followup/models.py @@ -513,6 +513,7 @@ class HeightWeight(Seasonisable): @property def bmi(self): + height = self.height / 100 return self.weight / (self.height * self.height) def __str__(self): diff --git a/jarvis/followup/templates/heightweight/list.html b/jarvis/followup/templates/heightweight/list.html index 90d2487..bd9133c 100644 --- a/jarvis/followup/templates/heightweight/list.html +++ b/jarvis/followup/templates/heightweight/list.html @@ -48,7 +48,7 @@ {{ heightweight.height }} {{ heightweight.hips_height }} {{ heightweight.weight }} - {{ heightweight.bmi }} + {{ heightweight.bmi | floatformat:2 }} {% endfor %}