Fix notion script + update lead-engine debug tools

This commit is contained in:
Jarvis
2026-01-31 17:37:32 +00:00
parent 30c19a546e
commit 278da72f4a
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
from db import get_leads
import json
def debug():
leads = get_leads()
print(f"--- DEBUGGING LEADS ({len(leads)}) ---")
for lead in leads:
print(f"ID: {lead['id']}")
print(f" Company: {lead['company_name']}")
print(f" Status: '{lead['status']}'") # Anführungszeichen wichtig um Leerschritte zu sehen
print(f" Enrichment: {lead['enrichment_data']}")
print("-" * 20)
if __name__ == "__main__":
debug()

View File

@@ -76,6 +76,7 @@ def get_status_options(db_id):
status = props.get("Status", {}).get("status", {})
return [opt["name"] for opt in status.get("options", [])]
def get_page_properties(page_id):
res = request("GET", f"https://api.notion.com/v1/pages/{page_id}")
return res.get("properties", {}) if res else {}