From 0c1ecabf2f88ed0d2a519fc1e3b474ceb0b5a6f7 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 18 May 2026 09:09:18 +0000 Subject: [PATCH] =?UTF-8?q?PAS=20falls=20back=20to=20coordination=20client?= =?UTF-8?q?=20when=20file=20listing=20returns=20401=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/pashub_fetcher/pashub_service.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/pashub_fetcher/pashub_service.py b/backend/pashub_fetcher/pashub_service.py index 0a5fb535..b33b9dcf 100644 --- a/backend/pashub_fetcher/pashub_service.py +++ b/backend/pashub_fetcher/pashub_service.py @@ -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")