filter out invalid schedule items

This commit is contained in:
Kyle Robbertze 2021-09-21 11:36:49 +02:00
parent fc02f8cafb
commit 6caa29e0c9
4 changed files with 44 additions and 23 deletions

View file

@ -68,6 +68,14 @@ class Schedule(models.Model):
return self.instance.ends
return self.ends
@property
def is_valid(self):
"""
A schedule item is valid if it starts before the end of the show instance
it is in
"""
return self.starts < self.instance.ends
class Meta:
managed = False
db_table = "cc_schedule"