{"action":"created","comment":{"url":"https://api.github.com/repos/raccoongang/edx-platform/pulls/comments/110370140","pull_request_review_id":31539353,"id":110370140,"diff_hunk":"@@ -0,0 +1,28 @@\n+from django.views.decorators.csrf import csrf_exempt\n+from django.utils.decorators import method_decorator\n+from django.shortcuts import redirect\n+from django.views.generic import View\n+from .models import TokenStorage\n+\n+\n+class ReceiveTokenView(View):\n+    \"\"\"\n+    This view receives a secret token from the remote server and save it to DB.\n+    In the future, this will allow us to exchange data with a remote server.\n+    \"\"\"\n+    @method_decorator(csrf_exempt)\n+    def dispatch(self, *args, **kwargs):\n+        return super(ReceiveTokenView, self).dispatch(*args, **kwargs)\n+\n+    def post(self, request, *args, **kwargs):\n+\n+        # Receive generated token from the remote server and save it to DB.\n+        try:\n+            received_data = self.request.POST\n+            secret_token = str(received_data.get('reverse_token'))\n+            token_object = TokenStorage.objects.get(pk=1)\n+            token_object.secret_token = secret_token\n+            token_object.save()\n+            return redirect('/')\n+        except ValueError:\n+            return redirect('/')","path":"openedx/core/djangoapps/global_statistics/views.py","position":28,"original_position":28,"commit_id":"cdaf8da3f5dc60604705f51abb8ae872089e286d","original_commit_id":"cdaf8da3f5dc60604705f51abb8ae872089e286d","user":{"login":"Shico-UA","id":10660080,"avatar_url":"https://avatars0.githubusercontent.com/u/10660080?v=3","gravatar_id":"","url":"https://api.github.com/users/Shico-UA","html_url":"https://github.com/Shico-UA","followers_url":"https://api.github.com/users/Shico-UA/followers","following_url":"https://api.github.com/users/Shico-UA/following{/other_user}","gists_url":"https://api.github.com/users/Shico-UA/gists{/gist_id}","starred_url":"https://api.github.com/users/Shico-UA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shico-UA/subscriptions","organizations_url":"https://api.github.com/users/Shico-UA/orgs","repos_url":"https://api.github.com/users/Shico-UA/repos","events_url":"https://api.github.com/users/Shico-UA/events{/privacy}","received_events_url":"https://api.github.com/users/Shico-UA/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2017-04-07T11:34:28Z","updated_at":"2017-04-07T11:34:28Z","html_url":"https://github.com/raccoongang/edx-platform/pull/59#discussion_r110370140","pull_request_url":"https://api.github.com/repos/raccoongang/edx-platform/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/raccoongang/edx-platform/pulls/comments/110370140"},"html":{"href":"https://github.com/raccoongang/edx-platform/pull/59#discussion_r110370140"},"pull_request":{"href":"https://api.github.com/repos/raccoongang/edx-platform/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/raccoongang/edx-platform/pulls/59","id":110826351,"html_url":"https://github.com/raccoongang/edx-platform/pull/59","diff_url":"https://github.com/raccoongang/edx-platform/pull/59.diff","patch_url":"https://github.com/raccoongang/edx-platform/pull/59.patch","issue_url":"https://api.github.com/repos/raccoongang/edx-platform/issues/59","number":59,"state":"open","locked":false,"title":"Initial commit","user":{"login":"Shico-UA","id":10660080,"avatar_url":"https://avatars0.githubusercontent.com/u/10660080?v=3","gravatar_id":"","url":"https://api.github.com/users/Shico-UA","html_url":"https://github.com/Shico-UA","followers_url":"https://api.github.com/users/Shico-UA/followers","following_url":"https://api.github.com/users/Shico-UA/following{/other_user}","gists_url":"https://api.github.com/users/Shico-UA/gists{/gist_id}","starred_url":"https://api.github.com/users/Shico-UA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shico-UA/subscriptions","organizations_url":"https://api.github.com/users/Shico-UA/orgs","repos_url":"https://api.github.com/users/Shico-UA/repos","events_url":"https://api.github.com/users/Shico-UA/events{/privacy}","received_events_url":"https://api.github.com/users/Shico-UA/received_events","type":"User","site_admin":false},"body":"@auraz \r\nAdded basic celery periodic task functionality which gathers info about amount of students and sends this info to any URL.\r\nYou should specify the right URL address inside the task to which the task should send the POST request if you want to see the results.\r\nI used this service for the testing purposes and for generation the test URL: http://requestb.in","created_at":"2017-03-15T11:48:10Z","updated_at":"2017-04-07T11:34:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c626b4c6517e702b39829ae43d751f0fcb605f56","assignee":{"login":"auraz","id":67241,"avatar_url":"https://avatars1.githubusercontent.com/u/67241?v=3","gravatar_id":"","url":"https://api.github.com/users/auraz","html_url":"https://github.com/auraz","followers_url":"https://api.github.com/users/auraz/followers","following_url":"https://api.github.com/users/auraz/following{/other_user}","gists_url":"https://api.github.com/users/auraz/gists{/gist_id}","starred_url":"https://api.github.com/users/auraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auraz/subscriptions","organizations_url":"https://api.github.com/users/auraz/orgs","repos_url":"https://api.github.com/users/auraz/repos","events_url":"https://api.github.com/users/auraz/events{/privacy}","received_events_url":"https://api.github.com/users/auraz/received_events","type":"User","site_admin":false},"assignees":[{"login":"auraz","id":67241,"avatar_url":"https://avatars1.githubusercontent.com/u/67241?v=3","gravatar_id":"","url":"https://api.github.com/users/auraz","html_url":"https://github.com/auraz","followers_url":"https://api.github.com/users/auraz/followers","following_url":"https://api.github.com/users/auraz/following{/other_user}","gists_url":"https://api.github.com/users/auraz/gists{/gist_id}","starred_url":"https://api.github.com/users/auraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auraz/subscriptions","organizations_url":"https://api.github.com/users/auraz/orgs","repos_url":"https://api.github.com/users/auraz/repos","events_url":"https://api.github.com/users/auraz/events{/privacy}","received_events_url":"https://api.github.com/users/auraz/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/raccoongang/edx-platform/pulls/59/commits","review_comments_url":"https://api.github.com/repos/raccoongang/edx-platform/pulls/59/comments","review_comment_url":"https://api.github.com/repos/raccoongang/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/raccoongang/edx-platform/issues/59/comments","statuses_url":"https://api.github.com/repos/raccoongang/edx-platform/statuses/cdaf8da3f5dc60604705f51abb8ae872089e286d","head":{"label":"raccoongang:edx_statistics","ref":"edx_statistics","sha":"cdaf8da3f5dc60604705f51abb8ae872089e286d","user":{"login":"raccoongang","id":11388447,"avatar_url":"https://avatars3.githubusercontent.com/u/11388447?v=3","gravatar_id":"","url":"https://api.github.com/users/raccoongang","html_url":"https://github.com/raccoongang","followers_url":"https://api.github.com/users/raccoongang/followers","following_url":"https://api.github.com/users/raccoongang/following{/other_user}","gists_url":"https://api.github.com/users/raccoongang/gists{/gist_id}","starred_url":"https://api.github.com/users/raccoongang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raccoongang/subscriptions","organizations_url":"https://api.github.com/users/raccoongang/orgs","repos_url":"https://api.github.com/users/raccoongang/repos","events_url":"https://api.github.com/users/raccoongang/events{/privacy}","received_events_url":"https://api.github.com/users/raccoongang/received_events","type":"Organization","site_admin":false},"repo":{"id":26811891,"name":"edx-platform","full_name":"raccoongang/edx-platform","owner":{"login":"raccoongang","id":11388447,"avatar_url":"https://avatars3.githubusercontent.com/u/11388447?v=3","gravatar_id":"","url":"https://api.github.com/users/raccoongang","html_url":"https://github.com/raccoongang","followers_url":"https://api.github.com/users/raccoongang/followers","following_url":"https://api.github.com/users/raccoongang/following{/other_user}","gists_url":"https://api.github.com/users/raccoongang/gists{/gist_id}","starred_url":"https://api.github.com/users/raccoongang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raccoongang/subscriptions","organizations_url":"https://api.github.com/users/raccoongang/orgs","repos_url":"https://api.github.com/users/raccoongang/repos","events_url":"https://api.github.com/users/raccoongang/events{/privacy}","received_events_url":"https://api.github.com/users/raccoongang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/raccoongang/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":true,"url":"https://api.github.com/repos/raccoongang/edx-platform","forks_url":"https://api.github.com/repos/raccoongang/edx-platform/forks","keys_url":"https://api.github.com/repos/raccoongang/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raccoongang/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raccoongang/edx-platform/teams","hooks_url":"https://api.github.com/repos/raccoongang/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/raccoongang/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/raccoongang/edx-platform/events","assignees_url":"https://api.github.com/repos/raccoongang/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/raccoongang/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/raccoongang/edx-platform/tags","blobs_url":"https://api.github.com/repos/raccoongang/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raccoongang/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raccoongang/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/raccoongang/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raccoongang/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/raccoongang/edx-platform/languages","stargazers_url":"https://api.github.com/repos/raccoongang/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/raccoongang/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/raccoongang/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/raccoongang/edx-platform/subscription","commits_url":"https://api.github.com/repos/raccoongang/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/raccoongang/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/raccoongang/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/raccoongang/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/raccoongang/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/raccoongang/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raccoongang/edx-platform/merges","archive_url":"https://api.github.com/repos/raccoongang/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raccoongang/edx-platform/downloads","issues_url":"https://api.github.com/repos/raccoongang/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/raccoongang/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/raccoongang/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/raccoongang/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raccoongang/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/raccoongang/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/raccoongang/edx-platform/deployments","created_at":"2014-11-18T14:05:58Z","updated_at":"2017-02-02T15:29:38Z","pushed_at":"2017-04-07T09:47:21Z","git_url":"git://github.com/raccoongang/edx-platform.git","ssh_url":"git@github.com:raccoongang/edx-platform.git","clone_url":"https://github.com/raccoongang/edx-platform.git","svn_url":"https://github.com/raccoongang/edx-platform","homepage":"http://openedx.org/","size":862475,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":5,"forks":9,"open_issues":5,"watchers":3,"default_branch":"master"}},"base":{"label":"raccoongang:master_olga","ref":"master_olga","sha":"3499b257c7fc3e47aacf3550ce116f34632ca6f7","user":{"login":"raccoongang","id":11388447,"avatar_url":"https://avatars3.githubusercontent.com/u/11388447?v=3","gravatar_id":"","url":"https://api.github.com/users/raccoongang","html_url":"https://github.com/raccoongang","followers_url":"https://api.github.com/users/raccoongang/followers","following_url":"https://api.github.com/users/raccoongang/following{/other_user}","gists_url":"https://api.github.com/users/raccoongang/gists{/gist_id}","starred_url":"https://api.github.com/users/raccoongang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raccoongang/subscriptions","organizations_url":"https://api.github.com/users/raccoongang/orgs","repos_url":"https://api.github.com/users/raccoongang/repos","events_url":"https://api.github.com/users/raccoongang/events{/privacy}","received_events_url":"https://api.github.com/users/raccoongang/received_events","type":"Organization","site_admin":false},"repo":{"id":26811891,"name":"edx-platform","full_name":"raccoongang/edx-platform","owner":{"login":"raccoongang","id":11388447,"avatar_url":"https://avatars3.githubusercontent.com/u/11388447?v=3","gravatar_id":"","url":"https://api.github.com/users/raccoongang","html_url":"https://github.com/raccoongang","followers_url":"https://api.github.com/users/raccoongang/followers","following_url":"https://api.github.com/users/raccoongang/following{/other_user}","gists_url":"https://api.github.com/users/raccoongang/gists{/gist_id}","starred_url":"https://api.github.com/users/raccoongang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raccoongang/subscriptions","organizations_url":"https://api.github.com/users/raccoongang/orgs","repos_url":"https://api.github.com/users/raccoongang/repos","events_url":"https://api.github.com/users/raccoongang/events{/privacy}","received_events_url":"https://api.github.com/users/raccoongang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/raccoongang/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":true,"url":"https://api.github.com/repos/raccoongang/edx-platform","forks_url":"https://api.github.com/repos/raccoongang/edx-platform/forks","keys_url":"https://api.github.com/repos/raccoongang/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raccoongang/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raccoongang/edx-platform/teams","hooks_url":"https://api.github.com/repos/raccoongang/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/raccoongang/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/raccoongang/edx-platform/events","assignees_url":"https://api.github.com/repos/raccoongang/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/raccoongang/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/raccoongang/edx-platform/tags","blobs_url":"https://api.github.com/repos/raccoongang/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raccoongang/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raccoongang/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/raccoongang/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raccoongang/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/raccoongang/edx-platform/languages","stargazers_url":"https://api.github.com/repos/raccoongang/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/raccoongang/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/raccoongang/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/raccoongang/edx-platform/subscription","commits_url":"https://api.github.com/repos/raccoongang/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/raccoongang/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/raccoongang/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/raccoongang/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/raccoongang/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/raccoongang/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raccoongang/edx-platform/merges","archive_url":"https://api.github.com/repos/raccoongang/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raccoongang/edx-platform/downloads","issues_url":"https://api.github.com/repos/raccoongang/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/raccoongang/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/raccoongang/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/raccoongang/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raccoongang/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/raccoongang/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/raccoongang/edx-platform/deployments","created_at":"2014-11-18T14:05:58Z","updated_at":"2017-02-02T15:29:38Z","pushed_at":"2017-04-07T09:47:21Z","git_url":"git://github.com/raccoongang/edx-platform.git","ssh_url":"git@github.com:raccoongang/edx-platform.git","clone_url":"https://github.com/raccoongang/edx-platform.git","svn_url":"https://github.com/raccoongang/edx-platform","homepage":"http://openedx.org/","size":862475,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":5,"forks":9,"open_issues":5,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/raccoongang/edx-platform/pulls/59"},"html":{"href":"https://github.com/raccoongang/edx-platform/pull/59"},"issue":{"href":"https://api.github.com/repos/raccoongang/edx-platform/issues/59"},"comments":{"href":"https://api.github.com/repos/raccoongang/edx-platform/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/raccoongang/edx-platform/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/raccoongang/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/raccoongang/edx-platform/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/raccoongang/edx-platform/statuses/cdaf8da3f5dc60604705f51abb8ae872089e286d"}}}}
{"actor":{"display_login":"Shico-UA"}}