Skip to content
Snippets Groups Projects
Commit 423b6576 authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

fix constraint checking bugs

parent 01085ec5
No related branches found
No related tags found
No related merge requests found
...@@ -425,7 +425,7 @@ class AKSlot(models.Model): ...@@ -425,7 +425,7 @@ class AKSlot(models.Model):
return (timezone.now() - self.updated).total_seconds() return (timezone.now() - self.updated).total_seconds()
def overlaps(self, other: "AKSlot"): 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): class AKOrgaMessage(models.Model):
......
...@@ -325,11 +325,11 @@ def akslot_changed_handler(sender, instance: AKSlot, **kwargs): ...@@ -325,11 +325,11 @@ def akslot_changed_handler(sender, instance: AKSlot, **kwargs):
print(f"Multiple slots in room {instance.room}: {new_violations}") print(f"Multiple slots in room {instance.room}: {new_violations}")
# ... and compare to/update list of existing violations of this type # ... and compare to/update list of existing violations of this type
# belonging to the slot that was recently changed (important!) # belonging to the slot that was recently changed (important!)
existing_violations_to_check = list(instance.constraintviolation_set.filter(type=violation_type)) existing_violations_to_check = list(instance.constraintviolation_set.filter(type=violation_type))
# print(existing_violations_to_check) # print(existing_violations_to_check)
update_constraint_violations(new_violations, existing_violations_to_check) update_constraint_violations(new_violations, existing_violations_to_check)
# == Check for reso ak after reso deadline == # == Check for reso ak after reso deadline ==
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment