{"action":"created","comment":{"url":"https://api.github.com/repos/mitodl/open-discussions/pulls/comments/227462231","pull_request_review_id":167508628,"id":227462231,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzQ2MjIzMQ==","diff_hunk":"@@ -8,11 +8,18 @@\n from social_django.models import UserSocialAuth\n \n from authentication.backends.micromasters import MicroMastersAuth\n+from open_discussions.features import INDEX_UPDATES","path":"profiles/views_test.py","position":4,"original_position":4,"commit_id":"90551305cf8bb4f8424f1ebdda3e1948d2f6a3ab","original_commit_id":"90551305cf8bb4f8424f1ebdda3e1948d2f6a3ab","user":{"login":"mbertrand","id":187676,"node_id":"MDQ6VXNlcjE4NzY3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/187676?v=4","gravatar_id":"","url":"https://api.github.com/users/mbertrand","html_url":"https://github.com/mbertrand","followers_url":"https://api.github.com/users/mbertrand/followers","following_url":"https://api.github.com/users/mbertrand/following{/other_user}","gists_url":"https://api.github.com/users/mbertrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mbertrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbertrand/subscriptions","organizations_url":"https://api.github.com/users/mbertrand/orgs","repos_url":"https://api.github.com/users/mbertrand/repos","events_url":"https://api.github.com/users/mbertrand/events{/privacy}","received_events_url":"https://api.github.com/users/mbertrand/received_events","type":"User","site_admin":false},"body":"For tests to pass, `INDEX_UPDATES` needs to be `False` or the index functions need to be mocked.  I went for the first option, but on second thought mocking the functions seems like a better choice.","created_at":"2018-10-23T16:06:56Z","updated_at":"2018-10-23T16:06:57Z","html_url":"https://github.com/mitodl/open-discussions/pull/1373#discussion_r227462231","pull_request_url":"https://api.github.com/repos/mitodl/open-discussions/pulls/1373","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mitodl/open-discussions/pulls/comments/227462231"},"html":{"href":"https://github.com/mitodl/open-discussions/pull/1373#discussion_r227462231"},"pull_request":{"href":"https://api.github.com/repos/mitodl/open-discussions/pulls/1373"}},"in_reply_to_id":226762067},"pull_request":{"url":"https://api.github.com/repos/mitodl/open-discussions/pulls/1373","id":223043123,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzMDQzMTIz","html_url":"https://github.com/mitodl/open-discussions/pull/1373","diff_url":"https://github.com/mitodl/open-discussions/pull/1373.diff","patch_url":"https://github.com/mitodl/open-discussions/pull/1373.patch","issue_url":"https://api.github.com/repos/mitodl/open-discussions/issues/1373","number":1373,"state":"open","locked":false,"title":"Index user profiles in Elasticsearch","user":{"login":"mbertrand","id":187676,"node_id":"MDQ6VXNlcjE4NzY3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/187676?v=4","gravatar_id":"","url":"https://api.github.com/users/mbertrand","html_url":"https://github.com/mbertrand","followers_url":"https://api.github.com/users/mbertrand/followers","following_url":"https://api.github.com/users/mbertrand/following{/other_user}","gists_url":"https://api.github.com/users/mbertrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mbertrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbertrand/subscriptions","organizations_url":"https://api.github.com/users/mbertrand/orgs","repos_url":"https://api.github.com/users/mbertrand/repos","events_url":"https://api.github.com/users/mbertrand/events{/privacy}","received_events_url":"https://api.github.com/users/mbertrand/received_events","type":"User","site_admin":false},"body":"#### Pre-Flight checklist\r\n- [x] Testing\r\n  - [x] Code is tested\r\n  - [x] Changes have been manually tested\r\n\r\n#### What are the relevant tickets?\r\nCloses #1317\r\n\r\n#### What's this PR do?\r\n- Adds a profile index\r\n- Adds a profile mapping and refactors common mapping fields\r\n- Index new profiles\r\n- Update the profile document when a profile is changed.\r\n- Update all relevant post/comment docs when a profile name or avatar is changed.\r\n- Corrects a mismatch between channel name and title when saving `Channel` objects.\r\n\r\n#### How should this be manually tested?\r\n- Run `python manage.py recreate_index`.  When done, there should be a `discussions_local_profile_default` index with documents for all existing profiles.\r\n- Edit your profile, changing bio and headline.  The changes should be reflected in the index doc for your profile.\r\n- Change the name and avatar of your profile.  The `author_name` and `author_avatar_small` fields of all your posts and comments should also be changed in ES.\r\n- Register a new user by email, and another new user via Micromasters.  When complete, the ES doc for each profile should exist and have the correct info.\r\n","created_at":"2018-10-15T21:06:17Z","updated_at":"2018-10-23T16:06:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6fc7d5e736a9150839b135dd6b03792e4be5529","assignee":{"login":"noisecapella","id":863262,"node_id":"MDQ6VXNlcjg2MzI2Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/863262?v=4","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false},"assignees":[{"login":"noisecapella","id":863262,"node_id":"MDQ6VXNlcjg2MzI2Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/863262?v=4","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":627438022,"node_id":"MDU6TGFiZWw2Mjc0MzgwMjI=","url":"https://api.github.com/repos/mitodl/open-discussions/labels/Waiting%20on%20Author","name":"Waiting on Author","color":"c5def5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mitodl/open-discussions/pulls/1373/commits","review_comments_url":"https://api.github.com/repos/mitodl/open-discussions/pulls/1373/comments","review_comment_url":"https://api.github.com/repos/mitodl/open-discussions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mitodl/open-discussions/issues/1373/comments","statuses_url":"https://api.github.com/repos/mitodl/open-discussions/statuses/90551305cf8bb4f8424f1ebdda3e1948d2f6a3ab","head":{"label":"mitodl:mb/indexprofile","ref":"mb/indexprofile","sha":"90551305cf8bb4f8424f1ebdda3e1948d2f6a3ab","user":{"login":"mitodl","id":7918516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MTg1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7918516?v=4","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"repo":{"id":93760926,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzc2MDkyNg==","name":"open-discussions","full_name":"mitodl/open-discussions","private":false,"owner":{"login":"mitodl","id":7918516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MTg1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7918516?v=4","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mitodl/open-discussions","description":null,"fork":false,"url":"https://api.github.com/repos/mitodl/open-discussions","forks_url":"https://api.github.com/repos/mitodl/open-discussions/forks","keys_url":"https://api.github.com/repos/mitodl/open-discussions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitodl/open-discussions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitodl/open-discussions/teams","hooks_url":"https://api.github.com/repos/mitodl/open-discussions/hooks","issue_events_url":"https://api.github.com/repos/mitodl/open-discussions/issues/events{/number}","events_url":"https://api.github.com/repos/mitodl/open-discussions/events","assignees_url":"https://api.github.com/repos/mitodl/open-discussions/assignees{/user}","branches_url":"https://api.github.com/repos/mitodl/open-discussions/branches{/branch}","tags_url":"https://api.github.com/repos/mitodl/open-discussions/tags","blobs_url":"https://api.github.com/repos/mitodl/open-discussions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitodl/open-discussions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitodl/open-discussions/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitodl/open-discussions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitodl/open-discussions/statuses/{sha}","languages_url":"https://api.github.com/repos/mitodl/open-discussions/languages","stargazers_url":"https://api.github.com/repos/mitodl/open-discussions/stargazers","contributors_url":"https://api.github.com/repos/mitodl/open-discussions/contributors","subscribers_url":"https://api.github.com/repos/mitodl/open-discussions/subscribers","subscription_url":"https://api.github.com/repos/mitodl/open-discussions/subscription","commits_url":"https://api.github.com/repos/mitodl/open-discussions/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitodl/open-discussions/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitodl/open-discussions/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitodl/open-discussions/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitodl/open-discussions/contents/{+path}","compare_url":"https://api.github.com/repos/mitodl/open-discussions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitodl/open-discussions/merges","archive_url":"https://api.github.com/repos/mitodl/open-discussions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitodl/open-discussions/downloads","issues_url":"https://api.github.com/repos/mitodl/open-discussions/issues{/number}","pulls_url":"https://api.github.com/repos/mitodl/open-discussions/pulls{/number}","milestones_url":"https://api.github.com/repos/mitodl/open-discussions/milestones{/number}","notifications_url":"https://api.github.com/repos/mitodl/open-discussions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitodl/open-discussions/labels{/name}","releases_url":"https://api.github.com/repos/mitodl/open-discussions/releases{/id}","deployments_url":"https://api.github.com/repos/mitodl/open-discussions/deployments","created_at":"2017-06-08T14:46:35Z","updated_at":"2018-10-23T14:37:40Z","pushed_at":"2018-10-23T15:19:41Z","git_url":"git://github.com/mitodl/open-discussions.git","ssh_url":"git@github.com:mitodl/open-discussions.git","clone_url":"https://github.com/mitodl/open-discussions.git","svn_url":"https://github.com/mitodl/open-discussions","homepage":null,"size":3808,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":93,"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":93,"watchers":4,"default_branch":"master"}},"base":{"label":"mitodl:master","ref":"master","sha":"74492e64cb462b344d751274cf65fc8df9d32fad","user":{"login":"mitodl","id":7918516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MTg1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7918516?v=4","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"repo":{"id":93760926,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzc2MDkyNg==","name":"open-discussions","full_name":"mitodl/open-discussions","private":false,"owner":{"login":"mitodl","id":7918516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MTg1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7918516?v=4","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mitodl/open-discussions","description":null,"fork":false,"url":"https://api.github.com/repos/mitodl/open-discussions","forks_url":"https://api.github.com/repos/mitodl/open-discussions/forks","keys_url":"https://api.github.com/repos/mitodl/open-discussions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitodl/open-discussions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitodl/open-discussions/teams","hooks_url":"https://api.github.com/repos/mitodl/open-discussions/hooks","issue_events_url":"https://api.github.com/repos/mitodl/open-discussions/issues/events{/number}","events_url":"https://api.github.com/repos/mitodl/open-discussions/events","assignees_url":"https://api.github.com/repos/mitodl/open-discussions/assignees{/user}","branches_url":"https://api.github.com/repos/mitodl/open-discussions/branches{/branch}","tags_url":"https://api.github.com/repos/mitodl/open-discussions/tags","blobs_url":"https://api.github.com/repos/mitodl/open-discussions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitodl/open-discussions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitodl/open-discussions/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitodl/open-discussions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitodl/open-discussions/statuses/{sha}","languages_url":"https://api.github.com/repos/mitodl/open-discussions/languages","stargazers_url":"https://api.github.com/repos/mitodl/open-discussions/stargazers","contributors_url":"https://api.github.com/repos/mitodl/open-discussions/contributors","subscribers_url":"https://api.github.com/repos/mitodl/open-discussions/subscribers","subscription_url":"https://api.github.com/repos/mitodl/open-discussions/subscription","commits_url":"https://api.github.com/repos/mitodl/open-discussions/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitodl/open-discussions/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitodl/open-discussions/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitodl/open-discussions/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitodl/open-discussions/contents/{+path}","compare_url":"https://api.github.com/repos/mitodl/open-discussions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitodl/open-discussions/merges","archive_url":"https://api.github.com/repos/mitodl/open-discussions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitodl/open-discussions/downloads","issues_url":"https://api.github.com/repos/mitodl/open-discussions/issues{/number}","pulls_url":"https://api.github.com/repos/mitodl/open-discussions/pulls{/number}","milestones_url":"https://api.github.com/repos/mitodl/open-discussions/milestones{/number}","notifications_url":"https://api.github.com/repos/mitodl/open-discussions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitodl/open-discussions/labels{/name}","releases_url":"https://api.github.com/repos/mitodl/open-discussions/releases{/id}","deployments_url":"https://api.github.com/repos/mitodl/open-discussions/deployments","created_at":"2017-06-08T14:46:35Z","updated_at":"2018-10-23T14:37:40Z","pushed_at":"2018-10-23T15:19:41Z","git_url":"git://github.com/mitodl/open-discussions.git","ssh_url":"git@github.com:mitodl/open-discussions.git","clone_url":"https://github.com/mitodl/open-discussions.git","svn_url":"https://github.com/mitodl/open-discussions","homepage":null,"size":3808,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":93,"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":93,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mitodl/open-discussions/pulls/1373"},"html":{"href":"https://github.com/mitodl/open-discussions/pull/1373"},"issue":{"href":"https://api.github.com/repos/mitodl/open-discussions/issues/1373"},"comments":{"href":"https://api.github.com/repos/mitodl/open-discussions/issues/1373/comments"},"review_comments":{"href":"https://api.github.com/repos/mitodl/open-discussions/pulls/1373/comments"},"review_comment":{"href":"https://api.github.com/repos/mitodl/open-discussions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mitodl/open-discussions/pulls/1373/commits"},"statuses":{"href":"https://api.github.com/repos/mitodl/open-discussions/statuses/90551305cf8bb4f8424f1ebdda3e1948d2f6a3ab"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mbertrand"}}