{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/27081126","id":27081126,"diff_hunk":"@@ -283,22 +284,32 @@ def dashboard(auth):\n @must_be_logged_in\n def watched_logs_get(**kwargs):\n     user = kwargs['auth'].user\n-    page_num = int(request.args.get('pageNum', '').strip('/') or 0)\n-    page_size = 10\n-    offset = page_num * page_size\n-    recent_log_ids = itertools.islice(user.get_recent_log_ids(), offset, offset + page_size + 1)\n+    try:\n+        page = int(request.args.get('page', 0))\n+    except ValueError:\n+        raise HTTPError(http.BAD_REQUEST, data=dict(\n+            message_long='Invalid value for \"page\".'\n+        ))\n+    try:\n+        size = int(request.args.get('size', 10))\n+    except ValueError:\n+        raise HTTPError(http.BAD_REQUEST, data=dict(\n+            message_long='Invalid value for \"size\".'\n+        ))\n+\n+    start = page * size\n+    total = sum(1 for x in user.get_recent_log_ids())\n+    recent_log_ids = itertools.islice(user.get_recent_log_ids(), start, start + size)","path":"website/views.py","position":31,"original_position":31,"commit_id":"4c7c2cd0e639fecafbab09de40b3a4f919e405c3","original_commit_id":"4c7c2cd0e639fecafbab09de40b3a4f919e405c3","user":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"body":"This is duplicated with the contributor pagination logic? Can we DRY this up somehow?","created_at":"2015-03-24T22:45:00Z","updated_at":"2015-03-24T22:45:00Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/2214#discussion_r27081126","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2214","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/27081126"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/2214#discussion_r27081126"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2214"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2214","id":31376367,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/2214","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/2214.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/2214.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2214","number":2214,"state":"open","locked":false,"title":"Feature/log paginator refactor","user":{"login":"chennan47","id":4974056,"avatar_url":"https://avatars.githubusercontent.com/u/4974056?v=3","gravatar_id":"","url":"https://api.github.com/users/chennan47","html_url":"https://github.com/chennan47","followers_url":"https://api.github.com/users/chennan47/followers","following_url":"https://api.github.com/users/chennan47/following{/other_user}","gists_url":"https://api.github.com/users/chennan47/gists{/gist_id}","starred_url":"https://api.github.com/users/chennan47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chennan47/subscriptions","organizations_url":"https://api.github.com/users/chennan47/orgs","repos_url":"https://api.github.com/users/chennan47/repos","events_url":"https://api.github.com/users/chennan47/events{/privacy}","received_events_url":"https://api.github.com/users/chennan47/received_events","type":"User","site_admin":false},"body":"<b>Purpose</b>\r\nchange the paginators for logs from the old \"more logs\" to the new page style\r\n\r\n\r\n<b>Changes</b>\r\nthe paginators for logs used to be\r\n![screen shot 2015-03-19 at 5 56 26 pm](https://cloud.githubusercontent.com/assets/4974056/6741838/53838ef2-ce61-11e4-91e5-990ee40179e8.png)\r\n\r\nnow it has changed to actual page structure\r\n![screen shot 2015-03-19 at 5 57 19 pm](https://cloud.githubusercontent.com/assets/4974056/6741853/7262c572-ce61-11e4-9793-aedab722fa63.png)\r\n","created_at":"2015-03-17T20:48:27Z","updated_at":"2015-03-24T22:45:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd6abb88976671aac03682057fd3b502c10d8705","assignee":null,"milestone":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones/27","html_url":"https://github.com/CenterForOpenScience/osf.io/milestones/0.30.0","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones/27/labels","id":1018606,"number":27,"title":"0.30.0","description":"","creator":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":20,"state":"open","created_at":"2015-03-12T16:56:31Z","updated_at":"2015-03-24T22:33:48Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2214/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2214/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2214/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/4c7c2cd0e639fecafbab09de40b3a4f919e405c3","head":{"label":"chennan47:feature/log_paginator_refactor","ref":"feature/log_paginator_refactor","sha":"4c7c2cd0e639fecafbab09de40b3a4f919e405c3","user":{"login":"chennan47","id":4974056,"avatar_url":"https://avatars.githubusercontent.com/u/4974056?v=3","gravatar_id":"","url":"https://api.github.com/users/chennan47","html_url":"https://github.com/chennan47","followers_url":"https://api.github.com/users/chennan47/followers","following_url":"https://api.github.com/users/chennan47/following{/other_user}","gists_url":"https://api.github.com/users/chennan47/gists{/gist_id}","starred_url":"https://api.github.com/users/chennan47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chennan47/subscriptions","organizations_url":"https://api.github.com/users/chennan47/orgs","repos_url":"https://api.github.com/users/chennan47/repos","events_url":"https://api.github.com/users/chennan47/events{/privacy}","received_events_url":"https://api.github.com/users/chennan47/received_events","type":"User","site_admin":false},"repo":{"id":26927567,"name":"osf.io","full_name":"chennan47/osf.io","owner":{"login":"chennan47","id":4974056,"avatar_url":"https://avatars.githubusercontent.com/u/4974056?v=3","gravatar_id":"","url":"https://api.github.com/users/chennan47","html_url":"https://github.com/chennan47","followers_url":"https://api.github.com/users/chennan47/followers","following_url":"https://api.github.com/users/chennan47/following{/other_user}","gists_url":"https://api.github.com/users/chennan47/gists{/gist_id}","starred_url":"https://api.github.com/users/chennan47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chennan47/subscriptions","organizations_url":"https://api.github.com/users/chennan47/orgs","repos_url":"https://api.github.com/users/chennan47/repos","events_url":"https://api.github.com/users/chennan47/events{/privacy}","received_events_url":"https://api.github.com/users/chennan47/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chennan47/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/chennan47/osf.io","forks_url":"https://api.github.com/repos/chennan47/osf.io/forks","keys_url":"https://api.github.com/repos/chennan47/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chennan47/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chennan47/osf.io/teams","hooks_url":"https://api.github.com/repos/chennan47/osf.io/hooks","issue_events_url":"https://api.github.com/repos/chennan47/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/chennan47/osf.io/events","assignees_url":"https://api.github.com/repos/chennan47/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/chennan47/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/chennan47/osf.io/tags","blobs_url":"https://api.github.com/repos/chennan47/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chennan47/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chennan47/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/chennan47/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chennan47/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/chennan47/osf.io/languages","stargazers_url":"https://api.github.com/repos/chennan47/osf.io/stargazers","contributors_url":"https://api.github.com/repos/chennan47/osf.io/contributors","subscribers_url":"https://api.github.com/repos/chennan47/osf.io/subscribers","subscription_url":"https://api.github.com/repos/chennan47/osf.io/subscription","commits_url":"https://api.github.com/repos/chennan47/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/chennan47/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/chennan47/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/chennan47/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/chennan47/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/chennan47/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chennan47/osf.io/merges","archive_url":"https://api.github.com/repos/chennan47/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chennan47/osf.io/downloads","issues_url":"https://api.github.com/repos/chennan47/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/chennan47/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/chennan47/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/chennan47/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chennan47/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/chennan47/osf.io/releases{/id}","created_at":"2014-11-20T19:12:43Z","updated_at":"2014-11-20T19:12:46Z","pushed_at":"2015-03-24T22:38:00Z","git_url":"git://github.com/chennan47/osf.io.git","ssh_url":"git@github.com:chennan47/osf.io.git","clone_url":"https://github.com/chennan47/osf.io.git","svn_url":"https://github.com/chennan47/osf.io","homepage":"http://osf.io","size":82557,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"be07cc18273baa13f55f7c340dd1c2ef48b692bd","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","created_at":"2013-05-21T15:53:37Z","updated_at":"2015-03-24T21:19:04Z","pushed_at":"2015-03-24T22:38:01Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"http://osf.io","size":101564,"stargazers_count":87,"watchers_count":87,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":364,"forks":63,"open_issues":364,"watchers":87,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2214"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/2214"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2214"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/2214/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2214/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/2214/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/4c7c2cd0e639fecafbab09de40b3a4f919e405c3"}}}}