Prevent checking in to cancelled events and dry hires

Will close #539
This commit is contained in:
2023-05-22 11:19:08 +01:00
parent 90ae87b1b2
commit a3458cea3d
6 changed files with 6 additions and 6 deletions

View File

@@ -497,7 +497,7 @@ class Event(models.Model, RevisionMixin):
earliest = datetime.datetime.combine(self.start_date, datetime.time(00, 00))
tz = pytz.timezone(settings.TIME_ZONE)
earliest = tz.localize(earliest)
return not self.dry_hire and earliest <= timezone.now()
return not self.dry_hire and not self.status == Event.CANCELLED and earliest <= timezone.now()
objects = EventManager()