diff --git a/etl/hubspot/hubspot_deal_differ.py b/etl/hubspot/hubspot_deal_differ.py index eb48fd464..22d7fb83c 100644 --- a/etl/hubspot/hubspot_deal_differ.py +++ b/etl/hubspot/hubspot_deal_differ.py @@ -1,3 +1,4 @@ +import os from typing import Any, Dict, List, Optional from backend.app.db.models.hubspot_deal_data import HubspotDealData @@ -344,8 +345,15 @@ class HubspotDealDiffer: == HubspotDealDiffer.ABRI_CONDITION_ASSOCIATED_PROJECT_ID ) + # TEST_ABRI_PROJECT_CODE_OVERRIDE lets a non-production deploy fire on a + # sandbox deal's own project code; unset (the production default) falls + # back to the real stock-condition code. + expected_code = ( + os.environ.get("TEST_ABRI_PROJECT_CODE_OVERRIDE") + or HubspotDealDiffer.ABRI_CONDITION_PROJECT_CODE + ) new_project_code = (new_deal.get("project_code") or "").lower() - return new_project_code == HubspotDealDiffer.ABRI_CONDITION_PROJECT_CODE.lower() + return new_project_code == expected_code.lower() @staticmethod def _has_valid_pashub_link(new_pashub_link: str) -> bool: