mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
get_evidence_files_by_job_id downloads other files when include_other=True 🟩
This commit is contained in:
parent
9cf6eaec4b
commit
ad4b88515d
1 changed files with 13 additions and 1 deletions
|
|
@ -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}")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue