From dd1ea99c3d9dda7ad969c693ba1a932ed4b967db Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 15 Jul 2026 09:34:37 +0000 Subject: [PATCH] =?UTF-8?q?Use=20the=20fetched=20gov=20cert=20when=20it=20?= =?UTF-8?q?is=20the=20newer=20assessment=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- applications/modelling_e2e/handler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/modelling_e2e/handler.py b/applications/modelling_e2e/handler.py index bbf88b5bc..8ff4497bd 100644 --- a/applications/modelling_e2e/handler.py +++ b/applications/modelling_e2e/handler.py @@ -393,6 +393,8 @@ def _newer_lodged( """ADR-0001 Recency Tie-Break over the two lodged sources. Returns (chosen, chosen_is_fetched) — the bool gates the EPC save, so a stored EPC that wins is never re-persisted.""" + if fetched is not None and fetched.inspection_date > stored.inspection_date: + return fetched, True return stored, False