Abri survey creation trigger falls back to project code only when no project is associated 🟩

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-02 16:29:11 +00:00
parent 911e77d7cf
commit fdeb15501f

View file

@ -191,12 +191,11 @@ class HubspotDealDiffer:
def _is_abri_condition_deal(
new_deal: Dict[str, str], new_project: Optional[ProjectData]
) -> bool:
if (
new_project is not None
and new_project["project_id"]
== HubspotDealDiffer.ABRI_CONDITION_ASSOCIATED_PROJECT_ID
):
return True
if new_project is not None:
return (
new_project["project_id"]
== HubspotDealDiffer.ABRI_CONDITION_ASSOCIATED_PROJECT_ID
)
new_project_code = (new_deal.get("project_code") or "").lower()
return new_project_code == HubspotDealDiffer.ABRI_CONDITION_PROJECT_CODE.lower()