Skip to content
Snippets Groups Projects
Commit 554b3871 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Fix constraint check for not-yet scheduled ak slots

parent 868a5198
No related branches found
No related tags found
No related merge requests found
......@@ -268,6 +268,7 @@ def akslot_changed_handler(sender, instance: AKSlot, **kwargs):
violation_type = ConstraintViolation.ViolationType.OWNER_TWO_SLOTS
new_violations = []
if instance.start:
# For all owners (after recent change)...
for owner in instance.ak.owners.all():
# ...find other slots that might be overlapping...
......@@ -339,6 +340,7 @@ def akslot_changed_handler(sender, instance: AKSlot, **kwargs):
violation_type = ConstraintViolation.ViolationType.AK_SLOT_COLLISION
new_violations = []
if instance.start:
# For all other slots of this ak...
for other_slot in instance.ak.akslot_set.filter(start__isnull=False):
if other_slot != instance:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment