From ad4b88515da492c4724fdb360cc2f641de34b19b Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 1 Jun 2026 15:14:30 +0000 Subject: [PATCH] =?UTF-8?q?`get=5Fevidence=5Ffiles=5Fby=5Fjob=5Fid`=20down?= =?UTF-8?q?loads=20other=20files=20when=20`include=5Fother=3DTrue`=20?= =?UTF-8?q?=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/pashub_fetcher/pashub_client.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/pashub_fetcher/pashub_client.py b/backend/pashub_fetcher/pashub_client.py index 084d4344..da44cf48 100644 --- a/backend/pashub_fetcher/pashub_client.py +++ b/backend/pashub_fetcher/pashub_client.py @@ -104,7 +104,19 @@ class PashubClient: logger.info("Successfully downloaded file") core_paths.append(file_path) - return DownloadedFiles(core=core_paths, other=[]) + other_paths: List[str] = [] + if include_other: + for evidence in grouped.other: + if not evidence.file_id: + continue + metadata = self._get_evidence_metadata(job_id, evidence.file_id) + download_url = self._build_download_url(metadata, evidence.file_id) + file_path = os.path.join("/tmp", evidence.file_name) + self._download_file(download_url, file_path) + logger.info("Successfully downloaded other file") + other_paths.append(file_path) + + return DownloadedFiles(core=core_paths, other=other_paths) def get_uprn_by_job_id(self, job_id: str) -> Optional[str]: logger.info(f"Getting UPRN for job ID {job_id}")