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

Prefetch in test and fix typing

parent a472b96d
No related branches found
No related tags found
No related merge requests found
Pipeline #274691 passed
...@@ -183,7 +183,7 @@ class AvailabilitiesFormMixin(forms.Form): ...@@ -183,7 +183,7 @@ class AvailabilitiesFormMixin(forms.Form):
for avail in availabilities: for avail in availabilities:
setattr(avail, reference_name, instance.id) setattr(avail, reference_name, instance.id)
def _replace_availabilities(self, instance, availabilities: [Availability]): def _replace_availabilities(self, instance, availabilities: list[Availability]):
""" """
Replace the existing list of availabilities belonging to an entity with a new, updated one Replace the existing list of availabilities belonging to an entity with a new, updated one
......
...@@ -78,7 +78,13 @@ class JSONExportTest(TestCase): ...@@ -78,7 +78,13 @@ class JSONExportTest(TestCase):
for participant in self.export_dict["participants"] for participant in self.export_dict["participants"]
} }
self.ak_slots = AKSlot.objects.filter(event__slug=event.slug).all() self.ak_slots = (
AKSlot.objects.filter(event__slug=event.slug)
.select_related("ak")
.prefetch_related("ak__conflicts")
.prefetch_related("ak__prerequisites")
.all()
)
self.rooms = Room.objects.filter(event__slug=event.slug).all() self.rooms = Room.objects.filter(event__slug=event.slug).all()
self.slots_in_an_hour = 1 / self.export_dict["timeslots"]["info"]["duration"] self.slots_in_an_hour = 1 / self.export_dict["timeslots"]["info"]["duration"]
self.event = event self.event = event
...@@ -563,7 +569,7 @@ class JSONExportTest(TestCase): ...@@ -563,7 +569,7 @@ class JSONExportTest(TestCase):
# test if time availability of room is restricted # test if time availability of room is restricted
if not Availability.is_event_covered( if not Availability.is_event_covered(
room.event, room.availabilities.all() event, room.availabilities.all()
): ):
time_constraints.add(f"availability-room-{room.pk}") time_constraints.add(f"availability-room-{room.pk}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment