{"action":"created","comment":{"url":"https://api.github.com/repos/edx/journals/pulls/comments/199640118","pull_request_review_id":133799223,"id":199640118,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTY0MDExOA==","diff_hunk":"@@ -62,3 +64,31 @@ def _revoke_access(self, order_number):\n                     access_record.journal,\n                     access_record.order_number)\n         return HttpResponse()\n+\n+\n+class UserPageVisitViewSet(viewsets.ModelViewSet):\n+    \"\"\"API for UserPageVisit model\"\"\"\n+    lookup_field = 'user_id'\n+    queryset = UserPageVisit.objects.all()\n+    serializer_class = UserPageVisitSerializer\n+    permission_classes = (IsAdminUser,)\n+\n+    def retrieve(self, request, *args, **kwargs):   # pylint: disable=unused-argument,useless-suppression\n+        \"\"\"\n+        Returns the user's visited pages.\n+        page_id is optional argument.\n+        \"\"\"\n+        user_id = kwargs['user_id']\n+        page_id = self.request.GET.get('page_id')\n+        queryset = self.queryset.filter(user_id=user_id)\n+        if page_id:\n+            queryset = queryset.filter(page_id=page_id)\n+        return Response(self.serializer_class(queryset, many=True).data)\n+\n+    @detail_route(url_path='lastvisit')\n+    def user_last_visited_page(self, request, user_id):  # pylint: disable=unused-argument,useless-suppression","path":"journals/apps/api/v1/views.py","position":50,"original_position":50,"commit_id":"afbe0215963e7c1133ecbe5b6c11ce6085de5679","original_commit_id":"afbe0215963e7c1133ecbe5b6c11ce6085de5679","user":{"login":"bill-filler","id":27503539,"node_id":"MDQ6VXNlcjI3NTAzNTM5","avatar_url":"https://avatars3.githubusercontent.com/u/27503539?v=4","gravatar_id":"","url":"https://api.github.com/users/bill-filler","html_url":"https://github.com/bill-filler","followers_url":"https://api.github.com/users/bill-filler/followers","following_url":"https://api.github.com/users/bill-filler/following{/other_user}","gists_url":"https://api.github.com/users/bill-filler/gists{/gist_id}","starred_url":"https://api.github.com/users/bill-filler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bill-filler/subscriptions","organizations_url":"https://api.github.com/users/bill-filler/orgs","repos_url":"https://api.github.com/users/bill-filler/repos","events_url":"https://api.github.com/users/bill-filler/events{/privacy}","received_events_url":"https://api.github.com/users/bill-filler/received_events","type":"User","site_admin":false},"body":"not sure why we need this either? I propose we try to accomplish all the functionality by using querystring parameters on a single endpoint (i..e. /pagevisits/?lastvisited=true) or something like that","created_at":"2018-07-02T22:36:51Z","updated_at":"2018-07-02T22:36:51Z","html_url":"https://github.com/edx/journals/pull/59#discussion_r199640118","pull_request_url":"https://api.github.com/repos/edx/journals/pulls/59","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/edx/journals/pulls/comments/199640118"},"html":{"href":"https://github.com/edx/journals/pull/59#discussion_r199640118"},"pull_request":{"href":"https://api.github.com/repos/edx/journals/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/edx/journals/pulls/59","id":198295127,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4Mjk1MTI3","html_url":"https://github.com/edx/journals/pull/59","diff_url":"https://github.com/edx/journals/pull/59.diff","patch_url":"https://github.com/edx/journals/pull/59.patch","issue_url":"https://api.github.com/repos/edx/journals/issues/59","number":59,"state":"open","locked":false,"title":" WL-1632 | Added UserPageVisit model and its endpoint.","user":{"login":"hasnain-naveed","id":8234192,"node_id":"MDQ6VXNlcjgyMzQxOTI=","avatar_url":"https://avatars0.githubusercontent.com/u/8234192?v=4","gravatar_id":"","url":"https://api.github.com/users/hasnain-naveed","html_url":"https://github.com/hasnain-naveed","followers_url":"https://api.github.com/users/hasnain-naveed/followers","following_url":"https://api.github.com/users/hasnain-naveed/following{/other_user}","gists_url":"https://api.github.com/users/hasnain-naveed/gists{/gist_id}","starred_url":"https://api.github.com/users/hasnain-naveed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasnain-naveed/subscriptions","organizations_url":"https://api.github.com/users/hasnain-naveed/orgs","repos_url":"https://api.github.com/users/hasnain-naveed/repos","events_url":"https://api.github.com/users/hasnain-naveed/events{/privacy}","received_events_url":"https://api.github.com/users/hasnain-naveed/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-29T11:51:57Z","updated_at":"2018-07-02T22:36:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cba902e2e6d9019c1621460123661b62431464b8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/journals/pulls/59/commits","review_comments_url":"https://api.github.com/repos/edx/journals/pulls/59/comments","review_comment_url":"https://api.github.com/repos/edx/journals/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/journals/issues/59/comments","statuses_url":"https://api.github.com/repos/edx/journals/statuses/afbe0215963e7c1133ecbe5b6c11ce6085de5679","head":{"label":"edx:hasnain-naveed/WL-1632","ref":"hasnain-naveed/WL-1632","sha":"afbe0215963e7c1133ecbe5b6c11ce6085de5679","user":{"login":"edx","id":3179841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzk4NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":126215869,"node_id":"MDEwOlJlcG9zaXRvcnkxMjYyMTU4Njk=","name":"journals","full_name":"edx/journals","owner":{"login":"edx","id":3179841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzk4NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/journals","description":"Service to create and serve journals for open edX.","fork":false,"url":"https://api.github.com/repos/edx/journals","forks_url":"https://api.github.com/repos/edx/journals/forks","keys_url":"https://api.github.com/repos/edx/journals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/journals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/journals/teams","hooks_url":"https://api.github.com/repos/edx/journals/hooks","issue_events_url":"https://api.github.com/repos/edx/journals/issues/events{/number}","events_url":"https://api.github.com/repos/edx/journals/events","assignees_url":"https://api.github.com/repos/edx/journals/assignees{/user}","branches_url":"https://api.github.com/repos/edx/journals/branches{/branch}","tags_url":"https://api.github.com/repos/edx/journals/tags","blobs_url":"https://api.github.com/repos/edx/journals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/journals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/journals/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/journals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/journals/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/journals/languages","stargazers_url":"https://api.github.com/repos/edx/journals/stargazers","contributors_url":"https://api.github.com/repos/edx/journals/contributors","subscribers_url":"https://api.github.com/repos/edx/journals/subscribers","subscription_url":"https://api.github.com/repos/edx/journals/subscription","commits_url":"https://api.github.com/repos/edx/journals/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/journals/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/journals/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/journals/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/journals/contents/{+path}","compare_url":"https://api.github.com/repos/edx/journals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/journals/merges","archive_url":"https://api.github.com/repos/edx/journals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/journals/downloads","issues_url":"https://api.github.com/repos/edx/journals/issues{/number}","pulls_url":"https://api.github.com/repos/edx/journals/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/journals/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/journals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/journals/labels{/name}","releases_url":"https://api.github.com/repos/edx/journals/releases{/id}","deployments_url":"https://api.github.com/repos/edx/journals/deployments","created_at":"2018-03-21T17:23:51Z","updated_at":"2018-06-29T10:51:28Z","pushed_at":"2018-07-02T15:35:57Z","git_url":"git://github.com/edx/journals.git","ssh_url":"git@github.com:edx/journals.git","clone_url":"https://github.com/edx/journals.git","svn_url":"https://github.com/edx/journals","homepage":"","size":4214,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"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":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"2ce5c9af20cae422eecae7ab1577772f49cd0ea6","user":{"login":"edx","id":3179841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzk4NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":126215869,"node_id":"MDEwOlJlcG9zaXRvcnkxMjYyMTU4Njk=","name":"journals","full_name":"edx/journals","owner":{"login":"edx","id":3179841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzk4NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/journals","description":"Service to create and serve journals for open edX.","fork":false,"url":"https://api.github.com/repos/edx/journals","forks_url":"https://api.github.com/repos/edx/journals/forks","keys_url":"https://api.github.com/repos/edx/journals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/journals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/journals/teams","hooks_url":"https://api.github.com/repos/edx/journals/hooks","issue_events_url":"https://api.github.com/repos/edx/journals/issues/events{/number}","events_url":"https://api.github.com/repos/edx/journals/events","assignees_url":"https://api.github.com/repos/edx/journals/assignees{/user}","branches_url":"https://api.github.com/repos/edx/journals/branches{/branch}","tags_url":"https://api.github.com/repos/edx/journals/tags","blobs_url":"https://api.github.com/repos/edx/journals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/journals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/journals/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/journals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/journals/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/journals/languages","stargazers_url":"https://api.github.com/repos/edx/journals/stargazers","contributors_url":"https://api.github.com/repos/edx/journals/contributors","subscribers_url":"https://api.github.com/repos/edx/journals/subscribers","subscription_url":"https://api.github.com/repos/edx/journals/subscription","commits_url":"https://api.github.com/repos/edx/journals/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/journals/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/journals/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/journals/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/journals/contents/{+path}","compare_url":"https://api.github.com/repos/edx/journals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/journals/merges","archive_url":"https://api.github.com/repos/edx/journals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/journals/downloads","issues_url":"https://api.github.com/repos/edx/journals/issues{/number}","pulls_url":"https://api.github.com/repos/edx/journals/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/journals/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/journals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/journals/labels{/name}","releases_url":"https://api.github.com/repos/edx/journals/releases{/id}","deployments_url":"https://api.github.com/repos/edx/journals/deployments","created_at":"2018-03-21T17:23:51Z","updated_at":"2018-06-29T10:51:28Z","pushed_at":"2018-07-02T15:35:57Z","git_url":"git://github.com/edx/journals.git","ssh_url":"git@github.com:edx/journals.git","clone_url":"https://github.com/edx/journals.git","svn_url":"https://github.com/edx/journals","homepage":"","size":4214,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"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":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/journals/pulls/59"},"html":{"href":"https://github.com/edx/journals/pull/59"},"issue":{"href":"https://api.github.com/repos/edx/journals/issues/59"},"comments":{"href":"https://api.github.com/repos/edx/journals/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/journals/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/journals/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/journals/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/edx/journals/statuses/afbe0215963e7c1133ecbe5b6c11ce6085de5679"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bill-filler"}}