From eab031b3cb6f5d0a10c4b7814160553afa185a78 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Sat, 7 Mar 2020 15:16:58 +0000 Subject: [PATCH] Fix for events with no access time --- RIGS/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIGS/models.py b/RIGS/models.py index 0efc915e..0b363dac 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -486,7 +486,7 @@ class Event(models.Model, RevisionMixin): if startEndSameDay and hasStartAndEnd and self.start_time > self.end_time: raise ValidationError('Unless you\'ve invented time travel, the event can\'t finish before it has started.') - accessAndStartSameDay = self.start_date == self.access_at.date() + accessAndStartSameDay = self.access_at is not None and self.start_date == self.access_at.date() if self.access_at.date() > self.start_date or (accessAndStartSameDay and self.access_at.time() > self.start_time): raise ValidationError('Regardless of what some clients might think, access time cannot be after the event has started.')