Skip to content
Snippets Groups Projects
Commit ed98da8d authored by Lorenzo Conti's avatar Lorenzo Conti
Browse files

Apply 3 suggestion(s) to 2 file(s)

parent 8501afaf
No related branches found
No related tags found
1 merge request!13Feature: Add export discretization length for JSON-export
Pipeline #271321 passed
...@@ -402,7 +402,7 @@ class Event(models.Model): ...@@ -402,7 +402,7 @@ class Event(models.Model):
""" """
if slots_in_an_hour is None: 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(): if DefaultSlot.objects.filter(event=self).exists():
# discretize default slots if they exists # discretize default slots if they exists
...@@ -1018,7 +1018,7 @@ class AKSlot(models.Model): ...@@ -1018,7 +1018,7 @@ class AKSlot(models.Model):
data = { data = {
"id": str(self.pk), "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": { "properties": {
"conflicts": "conflicts":
[str(conflict.pk) for conflict in conflict_slots.all()] [str(conflict.pk) for conflict in conflict_slots.all()]
......
...@@ -92,7 +92,7 @@ class AKJSONExportView(AdminViewMixin, FilterByEventSlugMixin, ListView): ...@@ -92,7 +92,7 @@ class AKJSONExportView(AdminViewMixin, FilterByEventSlugMixin, ListView):
context["rooms"] = rooms context["rooms"] = rooms
timeslots = { timeslots = {
"info": {"duration": (1.0 / float(self.event.export_slot)), }, "info": {"duration": float(self.event.export_slot)},
"blocks": [], "blocks": [],
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment