We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d65f8e commit c38819bCopy full SHA for c38819b
1 file changed
src/pytito/admin/account.py
@@ -72,13 +72,13 @@ def events(self) -> dict[str, Event]:
72
@property
73
def next_event(self) -> Event:
74
"""
75
- Return the chronologically first of the upcoming events
+ Return the chronologically first of the upcoming events, excluding events without a
76
+ start_at set
77
78
- # in some case draft event may not have a start date configured so must be excluded
79
+ # in some case a start date configured so must be excluded
80
def include_event(event: Event) -> bool:
- # pylint:disable-next=protected-access
81
- return event._json_content['start_at'] is not None
+ return event.start_at is not None
82
83
upcoming_events = list(filter(include_event, self.events.values()))
84
upcoming_events.sort(key=attrgetter('start_at'))
0 commit comments