diff --git a/etl/db/hubSpotLoad.py b/etl/db/hubSpotLoad.py index 7e435e9..617f2bc 100644 --- a/etl/db/hubSpotLoad.py +++ b/etl/db/hubSpotLoad.py @@ -104,12 +104,12 @@ class HubspotTodb: ), soft_assert( deal_in_db.coordination_status - == hs_listing.get("coordination_status__stage_1_"), - "uprn mismatch", + == hs_deal.get("coordination_status__stage_1_"), + "coordination stage 1 status mismatch", ), soft_assert( deal_in_db.design_status == hs_deal.get("retrofit_design_status"), - "outcome_notes mismatch", + "retrofit design mismatch", ), ] @@ -118,9 +118,8 @@ class HubspotTodb: print( f"❗ Discrepancies found for deal_id {deal_in_db.deal_id} — syncing with HubSpot." ) - return self.upsert_hubspot_deal( - hs_deal, hs_company_id, hs_listing, hubspot_client - ) + self.upsert_hubspot_deal(hs_deal, hs_company_id, hs_listing, hubspot_client) + return False # Handle photo upload if it exists but S3 URL is missing if ( @@ -157,6 +156,7 @@ class HubspotTodb: session.add(db_record) session.commit() print(f"✅ Updated DB with S3 URL for deal_id={deal_in_db.deal_id}") + return False else: print(f"✅ No update or upload required for deal_id {deal_in_db.deal_id}.") @@ -169,7 +169,6 @@ class HubspotTodb: Also uploads photos if present and adds S3 URL. """ with get_db_session() as session: - print("junte was here ") print(deal_data) deal_id = deal_data.get("hs_object_id") diff --git a/etl/hubSpotClient/scripts/hubspot_gather_all_deals.py b/etl/hubSpotClient/scripts/hubspot_gather_all_deals.py index d3480cb..904ed38 100644 --- a/etl/hubSpotClient/scripts/hubspot_gather_all_deals.py +++ b/etl/hubSpotClient/scripts/hubspot_gather_all_deals.py @@ -15,7 +15,7 @@ deals_to_add = [] deal_to_companies = {} for company_id in valuable_companies: - # 🔥 Cheap: company → deals + # 🔥 Cheap: company → deals deal_ids = hubspot.get_deals_from_company(company_id) for deal_id in tqdm(deal_ids, desc=f"Company {company_id}"):