Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Merge pull request #219 from theonion/ia-logging
Browse files Browse the repository at this point in the history
add more logging to IA requests
  • Loading branch information
MichaelButkovic committed Jun 10, 2016
2 parents b0420f2 + 4386876 commit 2f1c070
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions bulbs/content/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,12 @@ def delete_from_instant_article_api(sender, instance=None, **kwargs):
Error in deleting Instant Article.\n
Content ID: {0}\n
IA ID: {1}\n
Status Code: {2}'''.format(
Status Code: {2}
Request: {3}'''.format(
instance.id,
instance.instant_article_id,
delete.status_code))
delete.status_code,
delete.__dict__))
else:
status = delete.json().get('success')
if bool(status) is not True:
Expand Down
18 changes: 12 additions & 6 deletions bulbs/content/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ def post_article(content, body, fb_page_id, fb_api_url, fb_token_path, fb_dev_mo
Error in posting Instant Article.\n
Content ID: {0}\n
IA ID: {1}\n
Status Code: {2}'''.format(
Status Code: {2}
Request: {3}'''.format(
content.id,
content.instant_article_id,
post.status_code))
post.status_code,
post.__dict__))
return

# Poll for status of article
Expand All @@ -113,10 +115,12 @@ def post_article(content, body, fb_page_id, fb_api_url, fb_token_path, fb_dev_mo
Error in getting status of Instant Article.\n
Content ID: {0}\n
IA ID: {1}\n
Status Code: {2}'''.format(
Status Code: {2}
Request: {3}'''.format(
content.id,
content.instant_article_id,
status.status_code))
status.status_code,
status.__dict__))
return

response = status.json().get('status')
Expand All @@ -143,10 +147,12 @@ def delete_article(content, fb_api_url, fb_token_path):
Error in deleting Instant Article.\n
Content ID: {0}\n
IA ID: {1}\n
Status Code: {2}'''.format(
Status Code: {2}
Request: {3}'''.format(
content.id,
content.instant_article_id,
delete.status_code))
delete.status_code,
delete.__dict__))
else:
status = delete.json().get('success')
if bool(status) is not True:
Expand Down

0 comments on commit 2f1c070

Please sign in to comment.