Treat a blank surveyor as unset when checking for booking amendments 🟩

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-20 08:35:25 +00:00
parent 234270a1ca
commit 137ebd9456

View file

@ -320,7 +320,12 @@ class HubspotDealDiffer:
new_survey_date = parse_hs_date(new_deal.get("confirmed_survey_date"))
new_survey_time = new_deal.get("confirmed_survey_time")
new_surveyor = new_deal.get("third_party_surveyor_identifier")
# HubSpot sends "" for an unset property; the DB stores None. Treat
# them as the same so a booked deal doesn't amend on every scrape.
raw_surveyor = new_deal.get("third_party_surveyor_identifier")
new_surveyor = (
raw_surveyor if raw_surveyor is not None and raw_surveyor.strip() else None
)
logger.info(
"Abri job-amendment check: "
"old_confirmed_survey_date=%s new_confirmed_survey_date=%s "