diff --git a/etl/dimitra_hubspot_notes_gather.py b/etl/dimitra_hubspot_notes_gather.py index 39b970d..ec364e0 100644 --- a/etl/dimitra_hubspot_notes_gather.py +++ b/etl/dimitra_hubspot_notes_gather.py @@ -72,7 +72,11 @@ for pipeline in pipelines.results: week_label = get_week_label(note["created_at"]) if not week_label: continue - html_body = note['note'] + html_body = note.get('note') + if not html_body: + print(f"Skipping note with missing 'note' field: {note}") + continue + print(f"Debugging purposes html_body looks like {html_body}") soup = BeautifulSoup(html_body, "html.parser") plain_text = soup.get_text(separator="\n") @@ -92,7 +96,7 @@ for pipeline in pipelines.results: notes_data[pipeline_name].append({ "Deal Name": deal_name.upper(), - "Deal URL": f"https://app-eu1.hubspot.com/contacts/{portal_id}/record/0-3/{deals["deal_id"]}/", + "Deal URL": f"https://app-eu1.hubspot.com/contacts/{portal_id}/record/0-3/{deals['deal_id']}/", "Deal Owner": owner_name, "Deal Stage": stage.label.upper(), "Value": deals["value"],