Filter past events by `show_in_event_calendar` field in task processing

main
Arne Schauf 3 weeks ago
parent be2f999cc1
commit 1c4cfb25b1
  1. 2
      core/tasks.py

@ -17,7 +17,7 @@ def move_past_events_to_history():
today = date.today()
# Find all live EventPage objects with a start_date in the past
past_events = EventPage.objects.live().filter(
past_events = EventPage.objects.live().filter(show_in_event_calendar=True).filter(
Q(end_date__lt=timezone.now()) | Q(end_date__isnull=True, start_date__lt=timezone.now()))
# Find the first EventHistoryPage to use as the target for moving events

Loading…
Cancel
Save