{"action":"opened","number":35,"pull_request":{"url":"https://api.github.com/repos/andela/ah-scorpion/pulls/35","id":208516137,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NTE2MTM3","html_url":"https://github.com/andela/ah-scorpion/pull/35","diff_url":"https://github.com/andela/ah-scorpion/pull/35.diff","patch_url":"https://github.com/andela/ah-scorpion/pull/35.patch","issue_url":"https://api.github.com/repos/andela/ah-scorpion/issues/35","number":35,"state":"open","locked":false,"title":"#159053989 refactor like/dislike articles","user":{"login":"lennykioko","id":28927645,"node_id":"MDQ6VXNlcjI4OTI3NjQ1","avatar_url":"https://avatars3.githubusercontent.com/u/28927645?v=4","gravatar_id":"","url":"https://api.github.com/users/lennykioko","html_url":"https://github.com/lennykioko","followers_url":"https://api.github.com/users/lennykioko/followers","following_url":"https://api.github.com/users/lennykioko/following{/other_user}","gists_url":"https://api.github.com/users/lennykioko/gists{/gist_id}","starred_url":"https://api.github.com/users/lennykioko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lennykioko/subscriptions","organizations_url":"https://api.github.com/users/lennykioko/orgs","repos_url":"https://api.github.com/users/lennykioko/repos","events_url":"https://api.github.com/users/lennykioko/events{/privacy}","received_events_url":"https://api.github.com/users/lennykioko/received_events","type":"User","site_admin":false},"body":"**What does this PR do?**\r\n\r\n- Refactors the code to catch any 404 errors.\r\n- Ensures code conforms to PEP8.\r\n\r\n**Description of tasks completed**\r\n\r\n- Added try blocks to catch any 404 errors.\r\n- Added tests to test liking/disliking a comment that does not exist.\r\n- Refactored code to conform to PEP8.\r\n\r\n**How can this PR be manually tested?**\r\n\r\n- clone this branch.\r\n- go to the url of your favorite article and append` /like` e.g `api/v1/articles/<slug>/like` and make a PUT request to like it.\r\n- Repeating the above step will unlike the article.\r\n- go to the url of an article and append `/dislike` e.g `api/v1/articles/<slug>/dislike` and make a PUT request to dislike it.\r\n- Repeating the above step will un-dislike the article.\r\n- Doing any of the steps above for an article that does not exist/ by providing an invalid slug in the url will raise a custom `404` error.\r\n- run tests using `python manage.py test`. All tests should pass.\r\n\r\n**What are the relevant pivotal tracker stories?**\r\n\r\n[#159053989](https://www.pivotaltracker.com/story/show/159053989)","created_at":"2018-08-15T09:36:51Z","updated_at":"2018-08-15T09:36:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/ah-scorpion/pulls/35/commits","review_comments_url":"https://api.github.com/repos/andela/ah-scorpion/pulls/35/comments","review_comment_url":"https://api.github.com/repos/andela/ah-scorpion/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/ah-scorpion/issues/35/comments","statuses_url":"https://api.github.com/repos/andela/ah-scorpion/statuses/1a1eac3b527a14ff518a57a81029f489ee753e9f","head":{"label":"andela:ch-refactor-like/dislike-articles-#159053989","ref":"ch-refactor-like/dislike-articles-#159053989","sha":"1a1eac3b527a14ff518a57a81029f489ee753e9f","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":140683459,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA2ODM0NTk=","name":"ah-scorpion","full_name":"andela/ah-scorpion","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/ah-scorpion","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-scorpion","forks_url":"https://api.github.com/repos/andela/ah-scorpion/forks","keys_url":"https://api.github.com/repos/andela/ah-scorpion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-scorpion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-scorpion/teams","hooks_url":"https://api.github.com/repos/andela/ah-scorpion/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-scorpion/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-scorpion/events","assignees_url":"https://api.github.com/repos/andela/ah-scorpion/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-scorpion/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-scorpion/tags","blobs_url":"https://api.github.com/repos/andela/ah-scorpion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-scorpion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-scorpion/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-scorpion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-scorpion/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-scorpion/languages","stargazers_url":"https://api.github.com/repos/andela/ah-scorpion/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-scorpion/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-scorpion/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-scorpion/subscription","commits_url":"https://api.github.com/repos/andela/ah-scorpion/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-scorpion/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-scorpion/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-scorpion/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-scorpion/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-scorpion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-scorpion/merges","archive_url":"https://api.github.com/repos/andela/ah-scorpion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-scorpion/downloads","issues_url":"https://api.github.com/repos/andela/ah-scorpion/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-scorpion/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-scorpion/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-scorpion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-scorpion/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-scorpion/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-scorpion/deployments","created_at":"2018-07-12T08:19:13Z","updated_at":"2018-08-14T14:17:17Z","pushed_at":"2018-08-15T09:25:17Z","git_url":"git://github.com/andela/ah-scorpion.git","ssh_url":"git@github.com:andela/ah-scorpion.git","clone_url":"https://github.com/andela/ah-scorpion.git","svn_url":"https://github.com/andela/ah-scorpion","homepage":null,"size":169,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":5,"watchers":2,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"ead2850370e4559bd5cb908dff2ce1376f2d0a3d","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":140683459,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA2ODM0NTk=","name":"ah-scorpion","full_name":"andela/ah-scorpion","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/ah-scorpion","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-scorpion","forks_url":"https://api.github.com/repos/andela/ah-scorpion/forks","keys_url":"https://api.github.com/repos/andela/ah-scorpion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-scorpion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-scorpion/teams","hooks_url":"https://api.github.com/repos/andela/ah-scorpion/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-scorpion/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-scorpion/events","assignees_url":"https://api.github.com/repos/andela/ah-scorpion/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-scorpion/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-scorpion/tags","blobs_url":"https://api.github.com/repos/andela/ah-scorpion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-scorpion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-scorpion/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-scorpion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-scorpion/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-scorpion/languages","stargazers_url":"https://api.github.com/repos/andela/ah-scorpion/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-scorpion/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-scorpion/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-scorpion/subscription","commits_url":"https://api.github.com/repos/andela/ah-scorpion/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-scorpion/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-scorpion/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-scorpion/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-scorpion/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-scorpion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-scorpion/merges","archive_url":"https://api.github.com/repos/andela/ah-scorpion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-scorpion/downloads","issues_url":"https://api.github.com/repos/andela/ah-scorpion/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-scorpion/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-scorpion/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-scorpion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-scorpion/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-scorpion/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-scorpion/deployments","created_at":"2018-07-12T08:19:13Z","updated_at":"2018-08-14T14:17:17Z","pushed_at":"2018-08-15T09:25:17Z","git_url":"git://github.com/andela/ah-scorpion.git","ssh_url":"git@github.com:andela/ah-scorpion.git","clone_url":"https://github.com/andela/ah-scorpion.git","svn_url":"https://github.com/andela/ah-scorpion","homepage":null,"size":169,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":5,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/ah-scorpion/pulls/35"},"html":{"href":"https://github.com/andela/ah-scorpion/pull/35"},"issue":{"href":"https://api.github.com/repos/andela/ah-scorpion/issues/35"},"comments":{"href":"https://api.github.com/repos/andela/ah-scorpion/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/ah-scorpion/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/ah-scorpion/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/ah-scorpion/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/andela/ah-scorpion/statuses/1a1eac3b527a14ff518a57a81029f489ee753e9f"}},"author_association":"COLLABORATOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":64,"deletions":53,"changed_files":2}}
{"actor":{"display_login":"lennykioko"}}