Fix notion script + update lead-engine debug tools
This commit is contained in:
15
lead-engine/debug_leads.py
Normal file
15
lead-engine/debug_leads.py
Normal 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()
|
||||||
@@ -76,6 +76,7 @@ def get_status_options(db_id):
|
|||||||
status = props.get("Status", {}).get("status", {})
|
status = props.get("Status", {}).get("status", {})
|
||||||
return [opt["name"] for opt in status.get("options", [])]
|
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}")
|
res = request("GET", f"https://api.notion.com/v1/pages/{page_id}")
|
||||||
return res.get("properties", {}) if res else {}
|
return res.get("properties", {}) if res else {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user