From ed98da8ded352f56fc838552d7133839423c916b Mon Sep 17 00:00:00 2001
From: Lorenzo Conti <lorenzo@uni-bonn.de>
Date: Thu, 6 Feb 2025 18:14:09 +0000
Subject: [PATCH] Apply 3 suggestion(s) to 2 file(s)

Co-authored-by: Felix Blanke <s6feblan@uni-bonn.de>
---
 AKModel/models.py   | 4 ++--
 AKModel/views/ak.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/AKModel/models.py b/AKModel/models.py
index e3530861..8601a992 100644
--- a/AKModel/models.py
+++ b/AKModel/models.py
@@ -402,7 +402,7 @@ class Event(models.Model):
         """
 
         if slots_in_an_hour is None:
-            slots_in_an_hour = float(self.export_slot)
+            slots_in_an_hour = 1.0 / float(self.export_slot)
 
         if DefaultSlot.objects.filter(event=self).exists():
             # discretize default slots if they exists
@@ -1018,7 +1018,7 @@ class AKSlot(models.Model):
 
         data = {
             "id": str(self.pk),
-            "duration": math.ceil(self.duration * self.event.export_slot - ceil_offet_eps),
+            "duration": math.ceil(self.duration / self.event.export_slot - ceil_offet_eps),
             "properties": {
                 "conflicts":
                     [str(conflict.pk) for conflict in conflict_slots.all()]
diff --git a/AKModel/views/ak.py b/AKModel/views/ak.py
index d9a5e6a8..f6fd7932 100644
--- a/AKModel/views/ak.py
+++ b/AKModel/views/ak.py
@@ -92,7 +92,7 @@ class AKJSONExportView(AdminViewMixin, FilterByEventSlugMixin, ListView):
         context["rooms"] = rooms
 
         timeslots = {
-            "info": {"duration": (1.0 / float(self.event.export_slot)), },
+            "info": {"duration": float(self.event.export_slot)},
             "blocks": [],
             }
 
-- 
GitLab