Skip to content
Snippets Groups Projects
Commit e609497c authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Fix displayed duration for slots

Previously, a slot duration of exactly one hour was shown as "1: 0" instead of "1:00"
parent e29f05d5
No related branches found
No related tags found
1 merge request!97Fix displayed duration for slots
Pipeline #22074 passed
...@@ -348,7 +348,7 @@ class AKSlot(models.Model): ...@@ -348,7 +348,7 @@ class AKSlot(models.Model):
Display duration of slot in format hours:minutes, e.g. 1.5 -> "1:30" Display duration of slot in format hours:minutes, e.g. 1.5 -> "1:30"
""" """
hours, minutes = divmod(self.duration * 60, 60) hours, minutes = divmod(self.duration * 60, 60)
return f"{hours}:{minutes:2.0f}" return f"{int(hours)}:{int(minutes):02}"
@property @property
def start_simplified(self): def start_simplified(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment