PAS falls back to coordination client when file listing returns 401 🟩

This commit is contained in:
Daniel Roth 2026-05-18 09:09:18 +00:00
parent d49bd3620e
commit 0c1ecabf2f

View file

@ -71,9 +71,15 @@ class PashubService:
else:
logger.info(f"No UPRN found for job {job_id}")
job_files: List[str] = active_client.get_core_evidence_files_by_job_id(
job_id
)
try:
job_files: List[str] = active_client.get_core_evidence_files_by_job_id(
job_id
)
except UnauthorizedError:
if active_client is not self._pashub_client:
raise
active_client = self._get_coordination_client()
job_files = active_client.get_core_evidence_files_by_job_id(job_id)
if uprn or hubspot_deal_id:
logger.info("Uploading files to s3")