Skip to content
Snippets Groups Projects
Commit c73020b0 authored by Felix Blanke's avatar Felix Blanke
Browse files

Use uniform discretization if no default slots exist

parent 8d049baa
No related branches found
No related tags found
1 merge request!5Refactor main
Pipeline #266770 passed
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
...@@ -114,7 +114,13 @@ class AKJSONExportView(AdminViewMixin, FilterByEventSlugMixin, ListView): ...@@ -114,7 +114,13 @@ class AKJSONExportView(AdminViewMixin, FilterByEventSlugMixin, ListView):
if (values := AKSlot.objects.select_related().filter(ak__pk=ak_id, fixed=True)).exists() if (values := AKSlot.objects.select_related().filter(ak__pk=ak_id, fixed=True)).exists()
} }
for block in merge_blocks(self.event.default_time_slots(slots_in_an_hour=SLOTS_IN_AN_HOUR)): if DefaultSlot.objects.filter(event=self).exists():
# discretize default slots if they exists
blocks = merge_blocks(self.event.default_time_slots(slots_in_an_hour=SLOTS_IN_AN_HOUR))
else:
blocks = self.event.uniform_time_slots(slos_in_an_hour=SLOTS_IN_AN_HOUR)
for block in blocks:
current_block = [] current_block = []
for timeslot in block: for timeslot in block:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment