Spaces:
Running
Running
Update linkedin_follower_stats.py
Browse files
linkedin_follower_stats.py
CHANGED
|
@@ -381,10 +381,18 @@ def get_linkedin_follower_stats(comm_client_id, community_token, org_urn):
|
|
| 381 |
and format them for Bubble.
|
| 382 |
"""
|
| 383 |
if not all([comm_client_id, community_token, org_urn]):
|
| 384 |
-
logging.error("Client ID,
|
|
|
|
|
|
|
|
|
|
| 385 |
return []
|
| 386 |
|
| 387 |
token_dict = community_token if isinstance(community_token, dict) else {'access_token': community_token, 'token_type': 'Bearer'}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 388 |
|
| 389 |
session = None
|
| 390 |
try:
|
|
|
|
| 381 |
and format them for Bubble.
|
| 382 |
"""
|
| 383 |
if not all([comm_client_id, community_token, org_urn]):
|
| 384 |
+
logging.error("Client ID, community_token, or Organization URN is missing or empty.")
|
| 385 |
+
if not comm_client_id: logging.error("comm_client_id is missing.")
|
| 386 |
+
if not community_token: logging.error("community_token is missing or empty.") # This is key
|
| 387 |
+
if not org_urn: logging.error("org_urn is missing.")
|
| 388 |
return []
|
| 389 |
|
| 390 |
token_dict = community_token if isinstance(community_token, dict) else {'access_token': community_token, 'token_type': 'Bearer'}
|
| 391 |
+
|
| 392 |
+
if not token_dict.get('access_token'):
|
| 393 |
+
logging.error("Failed to construct a valid token_dict: 'access_token' is empty.")
|
| 394 |
+
logging.debug(f"Problematic token_dict: {token_dict}")
|
| 395 |
+
return []
|
| 396 |
|
| 397 |
session = None
|
| 398 |
try:
|