File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ def get_context_data(self, **kwargs):
8989class EventList (EventListBase ):
9090
9191 def get_queryset (self ):
92- return Event .objects .for_datetime (timezone .now ()).filter (calendar__slug = self .kwargs ['calendar_slug' ])
92+ return Event .objects .for_datetime (timezone .now ()).filter (calendar__slug = self .kwargs ['calendar_slug' ]). order_by ( 'occurring_rule__dt_start' )
9393
9494 def get_context_data (self , ** kwargs ):
9595 context = super ().get_context_data (** kwargs )
@@ -99,13 +99,8 @@ def get_context_data(self, **kwargs):
9999 calendar__slug = self .kwargs ['calendar_slug' ]))
100100 today_events .sort (key = lambda e : e .previous_time .dt_start if e .previous_time else timezone .now (), reverse = True )
101101 context ['events_today' ] = today_events [:2 ]
102-
103102 context ['calendar' ] = get_object_or_404 (Calendar , slug = self .kwargs ['calendar_slug' ])
104-
105- # upcoming events, soonest first
106- upcoming = list (self .get_queryset ())
107- upcoming .sort (key = lambda e : e .next_time .dt_start if e .next_time else timezone .now ())
108- context ['upcoming_events' ] = upcoming
103+ context ['upcoming_events' ] = context ['object_list' ]
109104
110105 return context
111106
You can’t perform that action at this time.
0 commit comments