diff --git a/AKModel/models.py b/AKModel/models.py index b2f15fd54693a27ac8b2ae316540f4f25da4a97a..70cc217d285ce606f79679042c89a1e2e30b8197 100644 --- a/AKModel/models.py +++ b/AKModel/models.py @@ -425,7 +425,7 @@ class AKSlot(models.Model): return (timezone.now() - self.updated).total_seconds() def overlaps(self, other: "AKSlot"): - return self.start <= other.end <= self.end or self.start <= other.start <= self.end + return self.start < other.end <= self.end or self.start <= other.start < self.end class AKOrgaMessage(models.Model): diff --git a/AKScheduling/models.py b/AKScheduling/models.py index 769b2ece69658d03dff0c2756cb54cfd05f03e9b..24f544f155606a440ae08cd9d6c9ba37c275654f 100644 --- a/AKScheduling/models.py +++ b/AKScheduling/models.py @@ -325,11 +325,11 @@ def akslot_changed_handler(sender, instance: AKSlot, **kwargs): print(f"Multiple slots in room {instance.room}: {new_violations}") - # ... and compare to/update list of existing violations of this type - # belonging to the slot that was recently changed (important!) - existing_violations_to_check = list(instance.constraintviolation_set.filter(type=violation_type)) - # print(existing_violations_to_check) - update_constraint_violations(new_violations, existing_violations_to_check) + # ... and compare to/update list of existing violations of this type + # belonging to the slot that was recently changed (important!) + existing_violations_to_check = list(instance.constraintviolation_set.filter(type=violation_type)) + # print(existing_violations_to_check) + update_constraint_violations(new_violations, existing_violations_to_check) # == Check for reso ak after reso deadline ==