raannakasturi commited on
Commit
4817ecd
·
1 Parent(s): 36b097c

Add detailed logging for post_post function success and error responses

Browse files
Files changed (1) hide show
  1. post_blog.py +2 -1
post_blog.py CHANGED
@@ -116,9 +116,10 @@ def post_post(title, category, body, image):
116
  }
117
  data = requests.post(url, headers=headers, json=post_data).json()
118
  if data['status'] == 'LIVE':
 
119
  return True
120
  else:
121
- print(data)
122
  return False
123
 
124
  def post_blog(title, category, summary, mindmap, citation, uaccess_key):
 
116
  }
117
  data = requests.post(url, headers=headers, json=post_data).json()
118
  if data['status'] == 'LIVE':
119
+ print(f"{title} is {data['status']}")
120
  return True
121
  else:
122
+ print(f"Error posting {title}: {data}")
123
  return False
124
 
125
  def post_blog(title, category, summary, mindmap, citation, uaccess_key):