{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/edx-platform/pulls/comments/244248930","pull_request_review_id":188203361,"id":244248930,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDI0ODkzMA==","diff_hunk":"@@ -376,6 +377,159 @@ def post(self, request):\n             return Response(text_type(exc), status=status.HTTP_500_INTERNAL_SERVER_ERROR)\n \n \n+\n+class DeactivateLogoutViewV2(APIView):\n+    \"\"\"\n+    POST /api/user/v1/accounts/deactivate_logoutv2/\n+    {\n+        \"password\": \"example_password\",\n+        \"useremail\": \"user1@example.com\",\n+    }\n+\n+    **POST Parameters**\n+\n+      A POST request can include one of the following parameter.\n+\n+      * useremail: Optional. the email of the user being deactivated\n+      * password: Required. The current password of the user being deactivated.\n+\n+    **POST Response Values**\n+\n+     If the request does not specify a username or submits a username\n+     for a non-existent user, the request returns an HTTP 404 \"Not Found\"\n+     response.\n+\n+     If a user who is not a superuser tries to deactivate a user,\n+     the request returns an HTTP 403 \"Forbidden\" response.\n+\n+     If the specified user is successfully deactivated, the request\n+     returns an HTTP 204 \"No Content\" response.\n+\n+     If an unanticipated error occurs, the request returns an\n+     HTTP 500 \"Internal Server Error\" response.\n+\n+    Allows an LMS user to take the following actions:\n+    -  Change the user's password permanently to Django's unusable password\n+    -  Log the user out\n+    - Create a row in the retirement table for that user\n+    \"\"\"\n+    authentication_classes = (SessionAuthentication, JwtAuthentication, )\n+    permission_classes = (permissions.IsAuthenticated, )\n+\n+    def post(self, request):\n+        \"\"\"\n+        POST /api/user/v2/accounts/deactivate_logoutv2/\n+\n+        Marks the user as having no password set for deactivation purposes,\n+        and logs the user out.\n+        \"\"\"\n+        user_model = get_user_model()\n+        try:\n+            oauth_account_deletion = settings.FEATURES.get('ENABLE_OAUTH_ACCOUNT_DELETION', False)\n+            if oauth_account_deletion:\n+                useremail = request.POST.get('useremail', False)\n+                if useremail:","path":"openedx/core/djangoapps/user_api/accounts/views.py","position":63,"original_position":63,"commit_id":"07c21816b5bd517e788e585038f17dfa3adf822a","original_commit_id":"07c21816b5bd517e788e585038f17dfa3adf822a","user":{"login":"eltoncarr","id":22648027,"node_id":"MDQ6VXNlcjIyNjQ4MDI3","avatar_url":"https://avatars3.githubusercontent.com/u/22648027?v=4","gravatar_id":"","url":"https://api.github.com/users/eltoncarr","html_url":"https://github.com/eltoncarr","followers_url":"https://api.github.com/users/eltoncarr/followers","following_url":"https://api.github.com/users/eltoncarr/following{/other_user}","gists_url":"https://api.github.com/users/eltoncarr/gists{/gist_id}","starred_url":"https://api.github.com/users/eltoncarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eltoncarr/subscriptions","organizations_url":"https://api.github.com/users/eltoncarr/orgs","repos_url":"https://api.github.com/users/eltoncarr/repos","events_url":"https://api.github.com/users/eltoncarr/events{/privacy}","received_events_url":"https://api.github.com/users/eltoncarr/received_events","type":"User","site_admin":false},"body":"- [ ] optionally update to user_email","created_at":"2018-12-28T01:32:12Z","updated_at":"2018-12-28T01:32:12Z","html_url":"https://github.com/Microsoft/edx-platform/pull/472#discussion_r244248930","pull_request_url":"https://api.github.com/repos/Microsoft/edx-platform/pulls/472","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/edx-platform/pulls/comments/244248930"},"html":{"href":"https://github.com/Microsoft/edx-platform/pull/472#discussion_r244248930"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/edx-platform/pulls/472"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/edx-platform/pulls/472","id":241047713,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMDQ3NzEz","html_url":"https://github.com/Microsoft/edx-platform/pull/472","diff_url":"https://github.com/Microsoft/edx-platform/pull/472.diff","patch_url":"https://github.com/Microsoft/edx-platform/pull/472.patch","issue_url":"https://api.github.com/repos/Microsoft/edx-platform/issues/472","number":472,"state":"open","locked":false,"title":"GDPR changes to support delete agent","user":{"login":"vivalams","id":21183036,"node_id":"MDQ6VXNlcjIxMTgzMDM2","avatar_url":"https://avatars0.githubusercontent.com/u/21183036?v=4","gravatar_id":"","url":"https://api.github.com/users/vivalams","html_url":"https://github.com/vivalams","followers_url":"https://api.github.com/users/vivalams/followers","following_url":"https://api.github.com/users/vivalams/following{/other_user}","gists_url":"https://api.github.com/users/vivalams/gists{/gist_id}","starred_url":"https://api.github.com/users/vivalams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivalams/subscriptions","organizations_url":"https://api.github.com/users/vivalams/orgs","repos_url":"https://api.github.com/users/vivalams/repos","events_url":"https://api.github.com/users/vivalams/events{/privacy}","received_events_url":"https://api.github.com/users/vivalams/received_events","type":"User","site_admin":false},"body":"#### What does this PR do? Please provide some context\r\nCreates a new v2 endpoint for deactivating the user account\r\n\r\n#### Where should the reviewer start?\r\ncommon.py -- has a new configuration entry for enabling OAuth deletion\r\n\r\n#### How can this be manually tested? (brief repro steps and corpnet-URL with change)\r\n1. Generate a access token from the below endpoint\r\n     http://{openedxurl}/oauth2/access_token\r\n2. Make a POST request passing the \"useremail\" in the body that needs to be deactivated along with token generated in Step 1 in the headers to the below endpoint\r\n   http://157.55.141.134/api/user/v1/accounts/deactivate_logoutv2/\r\n\r\n\r\n","created_at":"2018-12-26T23:10:56Z","updated_at":"2018-12-28T01:32:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29f51c5cb3413beffb7c90237814766ca8689b07","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/edx-platform/pulls/472/commits","review_comments_url":"https://api.github.com/repos/Microsoft/edx-platform/pulls/472/comments","review_comment_url":"https://api.github.com/repos/Microsoft/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/edx-platform/issues/472/comments","statuses_url":"https://api.github.com/repos/Microsoft/edx-platform/statuses/07c21816b5bd517e788e585038f17dfa3adf822a","head":{"label":"Microsoft:oxa/dev.haw_migration_2_GDPR","ref":"oxa/dev.haw_migration_2_GDPR","sha":"07c21816b5bd517e788e585038f17dfa3adf822a","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":65483935,"node_id":"MDEwOlJlcG9zaXRvcnk2NTQ4MzkzNQ==","name":"edx-platform","full_name":"Microsoft/edx-platform","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":true,"url":"https://api.github.com/repos/Microsoft/edx-platform","forks_url":"https://api.github.com/repos/Microsoft/edx-platform/forks","keys_url":"https://api.github.com/repos/Microsoft/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/edx-platform/teams","hooks_url":"https://api.github.com/repos/Microsoft/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/edx-platform/events","assignees_url":"https://api.github.com/repos/Microsoft/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/edx-platform/tags","blobs_url":"https://api.github.com/repos/Microsoft/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/edx-platform/languages","stargazers_url":"https://api.github.com/repos/Microsoft/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/edx-platform/subscription","commits_url":"https://api.github.com/repos/Microsoft/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/edx-platform/merges","archive_url":"https://api.github.com/repos/Microsoft/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/edx-platform/downloads","issues_url":"https://api.github.com/repos/Microsoft/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/edx-platform/deployments","created_at":"2016-08-11T16:18:42Z","updated_at":"2018-12-26T23:15:02Z","pushed_at":"2018-12-28T01:04:01Z","git_url":"git://github.com/Microsoft/edx-platform.git","ssh_url":"git@github.com:Microsoft/edx-platform.git","clone_url":"https://github.com/Microsoft/edx-platform.git","svn_url":"https://github.com/Microsoft/edx-platform","homepage":"http://open.edx.org/","size":944596,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":29,"open_issues":15,"watchers":22,"default_branch":"oxa/dev.fic"}},"base":{"label":"Microsoft:oxa/dev.haw_migration_2","ref":"oxa/dev.haw_migration_2","sha":"6044a451faaa4c62004ed1dec052ec88acb4302a","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":65483935,"node_id":"MDEwOlJlcG9zaXRvcnk2NTQ4MzkzNQ==","name":"edx-platform","full_name":"Microsoft/edx-platform","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":true,"url":"https://api.github.com/repos/Microsoft/edx-platform","forks_url":"https://api.github.com/repos/Microsoft/edx-platform/forks","keys_url":"https://api.github.com/repos/Microsoft/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/edx-platform/teams","hooks_url":"https://api.github.com/repos/Microsoft/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/edx-platform/events","assignees_url":"https://api.github.com/repos/Microsoft/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/edx-platform/tags","blobs_url":"https://api.github.com/repos/Microsoft/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/edx-platform/languages","stargazers_url":"https://api.github.com/repos/Microsoft/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/edx-platform/subscription","commits_url":"https://api.github.com/repos/Microsoft/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/edx-platform/merges","archive_url":"https://api.github.com/repos/Microsoft/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/edx-platform/downloads","issues_url":"https://api.github.com/repos/Microsoft/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/edx-platform/deployments","created_at":"2016-08-11T16:18:42Z","updated_at":"2018-12-26T23:15:02Z","pushed_at":"2018-12-28T01:04:01Z","git_url":"git://github.com/Microsoft/edx-platform.git","ssh_url":"git@github.com:Microsoft/edx-platform.git","clone_url":"https://github.com/Microsoft/edx-platform.git","svn_url":"https://github.com/Microsoft/edx-platform","homepage":"http://open.edx.org/","size":944596,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":29,"open_issues":15,"watchers":22,"default_branch":"oxa/dev.fic"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/edx-platform/pulls/472"},"html":{"href":"https://github.com/Microsoft/edx-platform/pull/472"},"issue":{"href":"https://api.github.com/repos/Microsoft/edx-platform/issues/472"},"comments":{"href":"https://api.github.com/repos/Microsoft/edx-platform/issues/472/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/edx-platform/pulls/472/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/edx-platform/pulls/472/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/edx-platform/statuses/07c21816b5bd517e788e585038f17dfa3adf822a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"eltoncarr"}}