From 5fca05176da4a93b01bd1f5342adf1cfb4ca3b3e Mon Sep 17 00:00:00 2001 From: Dinesh <97143739+dinesh-aot@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:11:52 -0700 Subject: [PATCH] event ordering issue (#1165) --- epictrack-api/src/api/services/event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epictrack-api/src/api/services/event.py b/epictrack-api/src/api/services/event.py index b41f2a2e7..7cce7cc8f 100644 --- a/epictrack-api/src/api/services/event.py +++ b/epictrack-api/src/api/services/event.py @@ -403,7 +403,7 @@ def _previous_event_acutal_date_rule( ) ) phase_events = sorted( - phase_events, key=lambda x: x.id + phase_events, key=lambda x: x.actual_date or x.anticipated_date ) event_index = -1 for index, item in enumerate(phase_events):