{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/comments/39287000","id":39287000,"diff_hunk":"@@ -12,13 +12,29 @@\n \n def generate_refund_file(request):\n     client = api_client.get_connection(request)\n-    refund_transactions = client.bank_admin.transactions.get(status='refund_pending')\n+    response = client.bank_admin.transactions.get(\n+        status='refund_pending',\n+        limit=settings.REQUEST_PAGE_SIZE\n+    )\n+    transactions_to_refund = response.get('results', [])\n+    total_count = response.get('count', 0)\n+\n+    num_reqs = 1","path":"mtp_bank_admin/apps/bank_admin/refund.py","position":12,"original_position":12,"commit_id":"a3dd62429dad7f20e06c18893f0156060aab80a0","original_commit_id":"a3dd62429dad7f20e06c18893f0156060aab80a0","user":{"login":"SteveMarshall","id":2210,"avatar_url":"https://avatars.githubusercontent.com/u/2210?v=3","gravatar_id":"","url":"https://api.github.com/users/SteveMarshall","html_url":"https://github.com/SteveMarshall","followers_url":"https://api.github.com/users/SteveMarshall/followers","following_url":"https://api.github.com/users/SteveMarshall/following{/other_user}","gists_url":"https://api.github.com/users/SteveMarshall/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveMarshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveMarshall/subscriptions","organizations_url":"https://api.github.com/users/SteveMarshall/orgs","repos_url":"https://api.github.com/users/SteveMarshall/repos","events_url":"https://api.github.com/users/SteveMarshall/events{/privacy}","received_events_url":"https://api.github.com/users/SteveMarshall/received_events","type":"User","site_admin":false},"body":"Given you're using `settings.REQUEST_PAGE_SIZE`, it might be clearer if this was `page_num`?","created_at":"2015-09-11T16:05:31Z","updated_at":"2015-09-11T16:05:31Z","html_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin/pull/5#discussion_r39287000","pull_request_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/comments/39287000"},"html":{"href":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin/pull/5#discussion_r39287000"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/5","id":44793699,"html_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin/pull/5","diff_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin/pull/5.diff","patch_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin/pull/5.patch","issue_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues/5","number":5,"state":"open","locked":false,"title":"Pagination","user":{"login":"ibrechin","id":733442,"avatar_url":"https://avatars.githubusercontent.com/u/733442?v=3","gravatar_id":"","url":"https://api.github.com/users/ibrechin","html_url":"https://github.com/ibrechin","followers_url":"https://api.github.com/users/ibrechin/followers","following_url":"https://api.github.com/users/ibrechin/following{/other_user}","gists_url":"https://api.github.com/users/ibrechin/gists{/gist_id}","starred_url":"https://api.github.com/users/ibrechin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibrechin/subscriptions","organizations_url":"https://api.github.com/users/ibrechin/orgs","repos_url":"https://api.github.com/users/ibrechin/repos","events_url":"https://api.github.com/users/ibrechin/events{/privacy}","received_events_url":"https://api.github.com/users/ibrechin/received_events","type":"User","site_admin":false},"body":"Add code to handle the pagination of the API, retrieving all pending refunds before generating the refund CSV.\r\n\r\nAlso fixed some typos (client app ID and dashboard.html).","created_at":"2015-09-11T15:12:24Z","updated_at":"2015-09-11T16:05:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0146524f5690c7143cb55900c7db55da434e4736","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/5/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/5/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues/5/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/statuses/a3dd62429dad7f20e06c18893f0156060aab80a0","head":{"label":"ministryofjustice:pagination","ref":"pagination","sha":"a3dd62429dad7f20e06c18893f0156060aab80a0","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":40470925,"name":"money-to-prisoners-bank-admin","full_name":"ministryofjustice/money-to-prisoners-bank-admin","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin","description":"Bank admin front-end for Money To Prisoners","fork":false,"url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin","forks_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/forks","keys_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/events","assignees_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/merges","archive_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/releases{/id}","created_at":"2015-08-10T08:13:03Z","updated_at":"2015-08-13T13:57:53Z","pushed_at":"2015-09-11T15:49:46Z","git_url":"git://github.com/ministryofjustice/money-to-prisoners-bank-admin.git","ssh_url":"git@github.com:ministryofjustice/money-to-prisoners-bank-admin.git","clone_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin.git","svn_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin","homepage":null,"size":324,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"b7d83bfd7a449e9a71094e03b05c2fbd347e729d","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":40470925,"name":"money-to-prisoners-bank-admin","full_name":"ministryofjustice/money-to-prisoners-bank-admin","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin","description":"Bank admin front-end for Money To Prisoners","fork":false,"url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin","forks_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/forks","keys_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/events","assignees_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/merges","archive_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/releases{/id}","created_at":"2015-08-10T08:13:03Z","updated_at":"2015-08-13T13:57:53Z","pushed_at":"2015-09-11T15:49:46Z","git_url":"git://github.com/ministryofjustice/money-to-prisoners-bank-admin.git","ssh_url":"git@github.com:ministryofjustice/money-to-prisoners-bank-admin.git","clone_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin.git","svn_url":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin","homepage":null,"size":324,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/5"},"html":{"href":"https://github.com/ministryofjustice/money-to-prisoners-bank-admin/pull/5"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues/5"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/money-to-prisoners-bank-admin/statuses/a3dd62429dad7f20e06c18893f0156060aab80a0"}}}}