{"action":"created","comment":{"url":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/comments/225223347","pull_request_review_id":164778363,"id":225223347,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTIyMzM0Nw==","diff_hunk":"@@ -0,0 +1,26 @@\n+from django.db import migrations\n+\n+\n+def update_officeblocks_location(apps, schema_editor):\n+    office_block = apps.get_model('core', 'OfficeBlock')\n+    andela_centres = apps.get_model('core', 'AndelaCentre')\n+    block_location = None\n+    for office_block in office_block.objects.all():\n+        # find kenya centre\n+        centre = andela_centres.objects.filter(country=\"Kenya\")[0]","path":"core/migrations/populate_officeblock_location.py","position":10,"original_position":10,"commit_id":"ffbf7d9aa725c6bc2f378fe3a05df59740f0245f","original_commit_id":"ffbf7d9aa725c6bc2f378fe3a05df59740f0245f","user":{"login":"esirK","id":13068580,"node_id":"MDQ6VXNlcjEzMDY4NTgw","avatar_url":"https://avatars3.githubusercontent.com/u/13068580?v=4","gravatar_id":"","url":"https://api.github.com/users/esirK","html_url":"https://github.com/esirK","followers_url":"https://api.github.com/users/esirK/followers","following_url":"https://api.github.com/users/esirK/following{/other_user}","gists_url":"https://api.github.com/users/esirK/gists{/gist_id}","starred_url":"https://api.github.com/users/esirK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esirK/subscriptions","organizations_url":"https://api.github.com/users/esirK/orgs","repos_url":"https://api.github.com/users/esirK/repos","events_url":"https://api.github.com/users/esirK/events{/privacy}","received_events_url":"https://api.github.com/users/esirK/received_events","type":"User","site_admin":false},"body":"I fear `andela_centres.objects.filter(country=\"Kenya\")[0]` might fail with an **IndexError** if no center has a **country** named **kenya**. We could use `andela_centres.objects.filter(country=\"Kenya\").exists()` instead.","created_at":"2018-10-15T16:01:30Z","updated_at":"2018-10-15T16:01:30Z","html_url":"https://github.com/AndelaOSP/art-backend/pull/192#discussion_r225223347","pull_request_url":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/192","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/comments/225223347"},"html":{"href":"https://github.com/AndelaOSP/art-backend/pull/192#discussion_r225223347"},"pull_request":{"href":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/192"}}},"pull_request":{"url":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/192","id":222946917,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyOTQ2OTE3","html_url":"https://github.com/AndelaOSP/art-backend/pull/192","diff_url":"https://github.com/AndelaOSP/art-backend/pull/192.diff","patch_url":"https://github.com/AndelaOSP/art-backend/pull/192.patch","issue_url":"https://api.github.com/repos/AndelaOSP/art-backend/issues/192","number":192,"state":"open","locked":false,"title":"[#160725918] Office Blocks should be tied to a location","user":{"login":"JoanNgatia","id":13269579,"node_id":"MDQ6VXNlcjEzMjY5NTc5","avatar_url":"https://avatars0.githubusercontent.com/u/13269579?v=4","gravatar_id":"","url":"https://api.github.com/users/JoanNgatia","html_url":"https://github.com/JoanNgatia","followers_url":"https://api.github.com/users/JoanNgatia/followers","following_url":"https://api.github.com/users/JoanNgatia/following{/other_user}","gists_url":"https://api.github.com/users/JoanNgatia/gists{/gist_id}","starred_url":"https://api.github.com/users/JoanNgatia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoanNgatia/subscriptions","organizations_url":"https://api.github.com/users/JoanNgatia/orgs","repos_url":"https://api.github.com/users/JoanNgatia/repos","events_url":"https://api.github.com/users/JoanNgatia/events{/privacy}","received_events_url":"https://api.github.com/users/JoanNgatia/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\n• Adds location field to office blocks and sets Kenya as the default location.\r\n\r\n### Description of the task to be completed:\r\n• Add location field on OfficeBlock model.\r\n• Create migration to set the location of existent blocks to Kenya.\r\n\r\n### How can this be manually tested?\r\nNavigate to office blocks endpoint \r\n\r\n### Relevant PT stories:\r\n[#160725692](https://www.pivotaltracker.com/story/show/160725918)","created_at":"2018-10-15T15:24:52Z","updated_at":"2018-10-15T16:01:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ef5c302da07f540252ab01b197fc1569636eca0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/192/commits","review_comments_url":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/192/comments","review_comment_url":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AndelaOSP/art-backend/issues/192/comments","statuses_url":"https://api.github.com/repos/AndelaOSP/art-backend/statuses/ffbf7d9aa725c6bc2f378fe3a05df59740f0245f","head":{"label":"AndelaOSP:ft-office-blocks-location-160725918","ref":"ft-office-blocks-location-160725918","sha":"ffbf7d9aa725c6bc2f378fe3a05df59740f0245f","user":{"login":"AndelaOSP","id":22083364,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDgzMzY0","avatar_url":"https://avatars1.githubusercontent.com/u/22083364?v=4","gravatar_id":"","url":"https://api.github.com/users/AndelaOSP","html_url":"https://github.com/AndelaOSP","followers_url":"https://api.github.com/users/AndelaOSP/followers","following_url":"https://api.github.com/users/AndelaOSP/following{/other_user}","gists_url":"https://api.github.com/users/AndelaOSP/gists{/gist_id}","starred_url":"https://api.github.com/users/AndelaOSP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndelaOSP/subscriptions","organizations_url":"https://api.github.com/users/AndelaOSP/orgs","repos_url":"https://api.github.com/users/AndelaOSP/repos","events_url":"https://api.github.com/users/AndelaOSP/events{/privacy}","received_events_url":"https://api.github.com/users/AndelaOSP/received_events","type":"Organization","site_admin":false},"repo":{"id":118765259,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg3NjUyNTk=","name":"art-backend","full_name":"AndelaOSP/art-backend","private":false,"owner":{"login":"AndelaOSP","id":22083364,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDgzMzY0","avatar_url":"https://avatars1.githubusercontent.com/u/22083364?v=4","gravatar_id":"","url":"https://api.github.com/users/AndelaOSP","html_url":"https://github.com/AndelaOSP","followers_url":"https://api.github.com/users/AndelaOSP/followers","following_url":"https://api.github.com/users/AndelaOSP/following{/other_user}","gists_url":"https://api.github.com/users/AndelaOSP/gists{/gist_id}","starred_url":"https://api.github.com/users/AndelaOSP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndelaOSP/subscriptions","organizations_url":"https://api.github.com/users/AndelaOSP/orgs","repos_url":"https://api.github.com/users/AndelaOSP/repos","events_url":"https://api.github.com/users/AndelaOSP/events{/privacy}","received_events_url":"https://api.github.com/users/AndelaOSP/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/AndelaOSP/art-backend","description":"This is the backend application for ART(Andela Resource Tracker)","fork":false,"url":"https://api.github.com/repos/AndelaOSP/art-backend","forks_url":"https://api.github.com/repos/AndelaOSP/art-backend/forks","keys_url":"https://api.github.com/repos/AndelaOSP/art-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AndelaOSP/art-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AndelaOSP/art-backend/teams","hooks_url":"https://api.github.com/repos/AndelaOSP/art-backend/hooks","issue_events_url":"https://api.github.com/repos/AndelaOSP/art-backend/issues/events{/number}","events_url":"https://api.github.com/repos/AndelaOSP/art-backend/events","assignees_url":"https://api.github.com/repos/AndelaOSP/art-backend/assignees{/user}","branches_url":"https://api.github.com/repos/AndelaOSP/art-backend/branches{/branch}","tags_url":"https://api.github.com/repos/AndelaOSP/art-backend/tags","blobs_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AndelaOSP/art-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/AndelaOSP/art-backend/languages","stargazers_url":"https://api.github.com/repos/AndelaOSP/art-backend/stargazers","contributors_url":"https://api.github.com/repos/AndelaOSP/art-backend/contributors","subscribers_url":"https://api.github.com/repos/AndelaOSP/art-backend/subscribers","subscription_url":"https://api.github.com/repos/AndelaOSP/art-backend/subscription","commits_url":"https://api.github.com/repos/AndelaOSP/art-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/AndelaOSP/art-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/AndelaOSP/art-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/AndelaOSP/art-backend/contents/{+path}","compare_url":"https://api.github.com/repos/AndelaOSP/art-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AndelaOSP/art-backend/merges","archive_url":"https://api.github.com/repos/AndelaOSP/art-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AndelaOSP/art-backend/downloads","issues_url":"https://api.github.com/repos/AndelaOSP/art-backend/issues{/number}","pulls_url":"https://api.github.com/repos/AndelaOSP/art-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/AndelaOSP/art-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/AndelaOSP/art-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AndelaOSP/art-backend/labels{/name}","releases_url":"https://api.github.com/repos/AndelaOSP/art-backend/releases{/id}","deployments_url":"https://api.github.com/repos/AndelaOSP/art-backend/deployments","created_at":"2018-01-24T12:53:21Z","updated_at":"2018-10-12T08:49:35Z","pushed_at":"2018-10-15T15:50:10Z","git_url":"git://github.com/AndelaOSP/art-backend.git","ssh_url":"git@github.com:AndelaOSP/art-backend.git","clone_url":"https://github.com/AndelaOSP/art-backend.git","svn_url":"https://github.com/AndelaOSP/art-backend","homepage":null,"size":669,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":7,"open_issues":4,"watchers":1,"default_branch":"develop"}},"base":{"label":"AndelaOSP:develop","ref":"develop","sha":"ed6df8c1c772e8a54212f2d85c45141eb8e9843c","user":{"login":"AndelaOSP","id":22083364,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDgzMzY0","avatar_url":"https://avatars1.githubusercontent.com/u/22083364?v=4","gravatar_id":"","url":"https://api.github.com/users/AndelaOSP","html_url":"https://github.com/AndelaOSP","followers_url":"https://api.github.com/users/AndelaOSP/followers","following_url":"https://api.github.com/users/AndelaOSP/following{/other_user}","gists_url":"https://api.github.com/users/AndelaOSP/gists{/gist_id}","starred_url":"https://api.github.com/users/AndelaOSP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndelaOSP/subscriptions","organizations_url":"https://api.github.com/users/AndelaOSP/orgs","repos_url":"https://api.github.com/users/AndelaOSP/repos","events_url":"https://api.github.com/users/AndelaOSP/events{/privacy}","received_events_url":"https://api.github.com/users/AndelaOSP/received_events","type":"Organization","site_admin":false},"repo":{"id":118765259,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg3NjUyNTk=","name":"art-backend","full_name":"AndelaOSP/art-backend","private":false,"owner":{"login":"AndelaOSP","id":22083364,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDgzMzY0","avatar_url":"https://avatars1.githubusercontent.com/u/22083364?v=4","gravatar_id":"","url":"https://api.github.com/users/AndelaOSP","html_url":"https://github.com/AndelaOSP","followers_url":"https://api.github.com/users/AndelaOSP/followers","following_url":"https://api.github.com/users/AndelaOSP/following{/other_user}","gists_url":"https://api.github.com/users/AndelaOSP/gists{/gist_id}","starred_url":"https://api.github.com/users/AndelaOSP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndelaOSP/subscriptions","organizations_url":"https://api.github.com/users/AndelaOSP/orgs","repos_url":"https://api.github.com/users/AndelaOSP/repos","events_url":"https://api.github.com/users/AndelaOSP/events{/privacy}","received_events_url":"https://api.github.com/users/AndelaOSP/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/AndelaOSP/art-backend","description":"This is the backend application for ART(Andela Resource Tracker)","fork":false,"url":"https://api.github.com/repos/AndelaOSP/art-backend","forks_url":"https://api.github.com/repos/AndelaOSP/art-backend/forks","keys_url":"https://api.github.com/repos/AndelaOSP/art-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AndelaOSP/art-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AndelaOSP/art-backend/teams","hooks_url":"https://api.github.com/repos/AndelaOSP/art-backend/hooks","issue_events_url":"https://api.github.com/repos/AndelaOSP/art-backend/issues/events{/number}","events_url":"https://api.github.com/repos/AndelaOSP/art-backend/events","assignees_url":"https://api.github.com/repos/AndelaOSP/art-backend/assignees{/user}","branches_url":"https://api.github.com/repos/AndelaOSP/art-backend/branches{/branch}","tags_url":"https://api.github.com/repos/AndelaOSP/art-backend/tags","blobs_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AndelaOSP/art-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/AndelaOSP/art-backend/languages","stargazers_url":"https://api.github.com/repos/AndelaOSP/art-backend/stargazers","contributors_url":"https://api.github.com/repos/AndelaOSP/art-backend/contributors","subscribers_url":"https://api.github.com/repos/AndelaOSP/art-backend/subscribers","subscription_url":"https://api.github.com/repos/AndelaOSP/art-backend/subscription","commits_url":"https://api.github.com/repos/AndelaOSP/art-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/AndelaOSP/art-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/AndelaOSP/art-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/AndelaOSP/art-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/AndelaOSP/art-backend/contents/{+path}","compare_url":"https://api.github.com/repos/AndelaOSP/art-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AndelaOSP/art-backend/merges","archive_url":"https://api.github.com/repos/AndelaOSP/art-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AndelaOSP/art-backend/downloads","issues_url":"https://api.github.com/repos/AndelaOSP/art-backend/issues{/number}","pulls_url":"https://api.github.com/repos/AndelaOSP/art-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/AndelaOSP/art-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/AndelaOSP/art-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AndelaOSP/art-backend/labels{/name}","releases_url":"https://api.github.com/repos/AndelaOSP/art-backend/releases{/id}","deployments_url":"https://api.github.com/repos/AndelaOSP/art-backend/deployments","created_at":"2018-01-24T12:53:21Z","updated_at":"2018-10-12T08:49:35Z","pushed_at":"2018-10-15T15:50:10Z","git_url":"git://github.com/AndelaOSP/art-backend.git","ssh_url":"git@github.com:AndelaOSP/art-backend.git","clone_url":"https://github.com/AndelaOSP/art-backend.git","svn_url":"https://github.com/AndelaOSP/art-backend","homepage":null,"size":669,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":7,"open_issues":4,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/192"},"html":{"href":"https://github.com/AndelaOSP/art-backend/pull/192"},"issue":{"href":"https://api.github.com/repos/AndelaOSP/art-backend/issues/192"},"comments":{"href":"https://api.github.com/repos/AndelaOSP/art-backend/issues/192/comments"},"review_comments":{"href":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/192/comments"},"review_comment":{"href":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AndelaOSP/art-backend/pulls/192/commits"},"statuses":{"href":"https://api.github.com/repos/AndelaOSP/art-backend/statuses/ffbf7d9aa725c6bc2f378fe3a05df59740f0245f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"esirK"}}