Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #449 from communitiesuk/FS-3548-continue-assessmen…
Browse files Browse the repository at this point in the history
…t-bug-fix

FS-3548 sort the updates based on time created
  • Loading branch information
RamuniN authored Oct 19, 2023
2 parents 4ecd20d + 0fc7ad8 commit e9b7065
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/blueprints/services/models/flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ def __post_init__(self):
item["date_created"]
).strftime("%Y-%m-%d %X")

# sort the updates in the order they are created
if self.updates:
self.updates = sorted(
self.updates, key=lambda x: x["date_created"]
)

self.latest_user_id = (
self.updates[-1]["user_id"] if self.updates else ""
)
Expand Down

0 comments on commit e9b7065

Please sign in to comment.