From 12efa24e2c20c80d8622d4737fbc37f6e5504188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=A4ttasch?= <benjamin.haettasch@fachschaft.informatik.tu-darmstadt.de> Date: Sat, 30 Jan 2021 14:56:09 +0100 Subject: [PATCH] Fix formation issue in simplified duration representation of AKSlot Also use this representation in durations list of AK --- AKModel/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AKModel/models.py b/AKModel/models.py index e614ea0b..121a4ac0 100644 --- a/AKModel/models.py +++ b/AKModel/models.py @@ -264,7 +264,7 @@ class AK(models.Model): @property def durations_list(self): - return ", ".join(str(slot.duration) for slot in self.akslot_set.all()) + return ", ".join(str(slot.duration_simplified) for slot in self.akslot_set.all()) @property def wish(self): @@ -342,7 +342,7 @@ class AKSlot(models.Model): Display duration of slot in format hours:minutes, e.g. 1.5 -> "1:30" """ hours, minutes = divmod(self.duration * 60, 60) - return f"{hours}:{minutes:2.0f}" + return f"{hours}:{minutes:02.0f}" @property def start_simplified(self): -- GitLab