diff --git a/home/models/pages.py b/home/models/pages.py index 9984c7b..9ce67b8 100644 --- a/home/models/pages.py +++ b/home/models/pages.py @@ -288,6 +288,8 @@ class EventPage(Page): Generate EventOccurrence objects for this event based on recurrence settings. For endless recurrence, generate up to days_ahead into the future. """ + from .event_occurrence import EventOccurrence + now = timezone.now() if not self.recurrence_enabled: # if recurrence is not enabled, ensure there's at least one occurrence for the specified start/end @@ -337,7 +339,8 @@ class EventPage(Page): def save(self, *args, **kwargs): super().save(*args, **kwargs) - self.generate_occurrences() + if self.live: + self.generate_occurrences() content_panels = Page.content_panels + [ FieldPanel("tags"),