diff --git a/AKModel/models.py b/AKModel/models.py index e3530861ae9179be76fc2e59585592ef04f8d455..8601a992ff365194fface4b867212353641209f4 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 d9a5e6a8deb13352cc297ac2941ede924a5d3591..f6fd79324161aa835a55fc4e22e30c0af85d83be 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": [], }