diff --git a/AKModel/models.py b/AKModel/models.py index 267f0bb07f09a03d6f7cf18460f6295d2a0f9357..1d12a76d9dbd73b423923c3237081eff0b0b0820 100644 --- a/AKModel/models.py +++ b/AKModel/models.py @@ -955,6 +955,7 @@ class AKSlot(models.Model): conflict_slots = AKSlot.objects.filter(ak__in=self.ak.conflicts.all()) dependency_slots = AKSlot.objects.filter(ak__in=self.ak.prerequisites.all()) + other_ak_slots = AKSlot.objects.filter(ak=self.ak).exclude(pk=self.pk) ceil_offet_eps = decimal.Decimal(1e-4) @@ -963,7 +964,9 @@ class AKSlot(models.Model): "id": str(self.pk), "duration": math.ceil(self.duration * self.slots_in_an_hour - ceil_offet_eps), "properties": { - "conflicts": [str(conflict.pk) for conflict in conflict_slots.all()], + "conflicts": + [str(conflict.pk) for conflict in conflict_slots.all()] + + [str(second_slot.pk) for second_slot in other_ak_slots.all()], "dependencies": [str(dep.pk) for dep in dependency_slots.all()], }, "room_constraints": [constraint.name @@ -976,6 +979,7 @@ class AKSlot(models.Model): "description": self.ak.description, "reso": self.ak.reso, "duration_in_hours": float(self.duration), + "django_ak_id": str(self.ak.pk), }, }