diff --git a/backend/pashub_fetcher/pashub_client.py b/backend/pashub_fetcher/pashub_client.py index 556884fe..4435c278 100644 --- a/backend/pashub_fetcher/pashub_client.py +++ b/backend/pashub_fetcher/pashub_client.py @@ -116,6 +116,9 @@ class PashubClient: latest_files: Dict[CoreFiles, EvidenceFileData] = {} for core_type, group in grouped.items(): + if core_type == CoreFiles.RETROFIT_DESIGN_DOC and len(group) > 1: + osm_candidates = [f for f in group if "-OSM-" in f.file_name] + group = osm_candidates if osm_candidates else group latest = max(group, key=lambda f: datetime.fromisoformat(f.created_utc)) latest_files[core_type] = latest