Skip to content

Commit

Permalink
Make event upcoming logic use end date instead of start date
Browse files Browse the repository at this point in the history
  • Loading branch information
rlskoeser committed Sep 6, 2024
1 parent 94b4f29 commit 21ec049
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cdhweb/pages/blocks/event_index_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ def get_context(self, value, parent_context=None):

current_datetime = timezone.now()

# NOTE: possible to use EventQuerySet here with .upcoming() filter?
child_pages = (
value.get("landing_page")
.get_children()
.live()
.public()
.filter(event__start_time__gt=current_datetime) # only show upcoming events
.filter(end__start_time__gt=current_datetime) # only show upcoming events
.order_by("event__start_time") # Sort by date ascending
.specific()
)
Expand Down

0 comments on commit 21ec049

Please sign in to comment.