more robost

This commit is contained in:
Jun-te Kim 2025-06-17 08:12:41 +00:00
parent 413538ac3c
commit c40c991320

View file

@ -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"],