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

Check all blocks of union if event is covered

parent 25a3b3f9
No related branches found
No related tags found
1 merge request!5Refactor main
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
...@@ -293,7 +293,7 @@ class Availability(models.Model): ...@@ -293,7 +293,7 @@ class Availability(models.Model):
# event end + 1 day # event end + 1 day
full_event = Availability(event=event, start=event.start, end=event.end) full_event = Availability(event=event, start=event.start, end=event.end)
avail_union = Availability.union(availabilities) avail_union = Availability.union(availabilities)
return not avail_union or avail_union[0].contains(full_event) return any(avail.contains(full_event) for avail in avail_union)
class Meta: class Meta:
verbose_name = _('Availability') verbose_name = _('Availability')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment