[30388f42] Infrastructure Hardening: Repaired CE/Connector DB schema, fixed frontend styling build, implemented robust echo shield in worker v2.1.1, and integrated Lead Engine into gateway.
This commit is contained in:
35
connector-superoffice/tools/debug_names.py
Normal file
35
connector-superoffice/tools/debug_names.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import sys
|
||||
import os
|
||||
import json
|
||||
|
||||
# Absolute path setup
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
connector_dir = os.path.abspath(os.path.join(current_dir, '..'))
|
||||
sys.path.insert(0, connector_dir)
|
||||
|
||||
from superoffice_client import SuperOfficeClient
|
||||
|
||||
def debug_names():
|
||||
print("🔎 Debugging Associate Names...")
|
||||
client = SuperOfficeClient()
|
||||
if not client.access_token:
|
||||
print("❌ Auth failed.")
|
||||
return
|
||||
|
||||
endpoint = "Contact?$orderby=contactId desc&$top=5&$select=name,Associate/Name"
|
||||
|
||||
print(f"📡 Querying: {endpoint}")
|
||||
contacts = client.search(endpoint)
|
||||
|
||||
if contacts:
|
||||
for c in contacts:
|
||||
cname = c.get('name')
|
||||
assoc = c.get('Associate') or {}
|
||||
aname = assoc.get('Name')
|
||||
print(f" 🏢 Contact: {cname}")
|
||||
print(f" 👉 Associate Name: '{aname}'")
|
||||
else:
|
||||
print("❌ No contacts found.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
debug_names()
|
||||
Reference in New Issue
Block a user