Skip to content

Commit 488a6bb

Browse files
fix meetup import
1 parent a55655d commit 488a6bb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tools/meetup_import.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,12 @@ def is_future(event):
314314
past_events = [e for e in all_events if not is_future(e)]
315315
future_events = [e for e in all_events if is_future(e)]
316316

317-
# Sort only the future events by expiration - past events will already be sorted by date
317+
# Sort both past and future events by expiration date
318+
past_events_sorted = sorted(past_events, key=lambda e: e.get("expiration", "") if isinstance(e, dict) else getattr(e, "expiration", ""))
318319
future_events_sorted = sorted(future_events, key=lambda e: e.get("expiration", "") if isinstance(e, dict) else getattr(e, "expiration", ""))
319320

320-
# Concatenate past (already sorted) + sorted future
321-
return past_events + future_events_sorted
321+
# Concatenate sorted past + sorted future
322+
return past_events_sorted + future_events_sorted
322323

323324
def write_all_events_to_yaml_file(file_path, all_events: list[dict]):
324325
try:

0 commit comments

Comments
 (0)