{"action":"created","comment":{"url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/comments/115708026","pull_request_review_id":37268136,"id":115708026,"diff_hunk":"@@ -107,18 +117,30 @@ def get_elements(self):\n         elements.append(heading)\n \n         for question_group in self.survey['question_groups']:\n+            has_section_heading_output = False\n \n             if 'title' in question_group:\n-                elements.append(Paragraph(question_group['title'], styleSH))\n \n                 for question in question_group['questions']:\n                     if 'text' in question:\n                         answer = ''\n                         if question['question_id'] in self.response['data']:\n                             answer = self.response['data'][question['question_id']]\n \n-                        elements.append(Paragraph(question['text'], styleSSH))\n-                        elements.append(Paragraph(answer, styleN))\n+                            # Output the section header if we haven't already\n+                            # Checking here so that whole sections are suppressed\n+                            # if they have no answers.\n+                            if not has_section_heading_output:\n+                                elements.append(HRFlowable(width=\"100%\"))\n+                                elements.append(Paragraph(question_group['title'], styleSH))\n+                                has_section_heading_output = True\n+\n+                            # Question not output if answer is empty\n+                            text = question.get(\"text\", \" \")","path":"transform/transformers/PDFTransformer.py","position":61,"original_position":61,"commit_id":"40c76bcd4615bc19757f7901befbc4594d710401","original_commit_id":"40c76bcd4615bc19757f7901befbc4594d710401","user":{"login":"shahi645","id":22025926,"avatar_url":"https://avatars3.githubusercontent.com/u/22025926?v=3","gravatar_id":"","url":"https://api.github.com/users/shahi645","html_url":"https://github.com/shahi645","followers_url":"https://api.github.com/users/shahi645/followers","following_url":"https://api.github.com/users/shahi645/following{/other_user}","gists_url":"https://api.github.com/users/shahi645/gists{/gist_id}","starred_url":"https://api.github.com/users/shahi645/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shahi645/subscriptions","organizations_url":"https://api.github.com/users/shahi645/orgs","repos_url":"https://api.github.com/users/shahi645/repos","events_url":"https://api.github.com/users/shahi645/events{/privacy}","received_events_url":"https://api.github.com/users/shahi645/received_events","type":"User","site_admin":false},"body":"done","created_at":"2017-05-10T10:40:05Z","updated_at":"2017-05-10T10:40:05Z","html_url":"https://github.com/ONSdigital/sdx-transform-cora/pull/22#discussion_r115708026","pull_request_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/comments/115708026"},"html":{"href":"https://github.com/ONSdigital/sdx-transform-cora/pull/22#discussion_r115708026"},"pull_request":{"href":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/22","id":119670833,"html_url":"https://github.com/ONSdigital/sdx-transform-cora/pull/22","diff_url":"https://github.com/ONSdigital/sdx-transform-cora/pull/22.diff","patch_url":"https://github.com/ONSdigital/sdx-transform-cora/pull/22.patch","issue_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues/22","number":22,"state":"open","locked":false,"title":"Image modifier changes","user":{"login":"shahi645","id":22025926,"avatar_url":"https://avatars3.githubusercontent.com/u/22025926?v=3","gravatar_id":"","url":"https://api.github.com/users/shahi645","html_url":"https://github.com/shahi645","followers_url":"https://api.github.com/users/shahi645/followers","following_url":"https://api.github.com/users/shahi645/following{/other_user}","gists_url":"https://api.github.com/users/shahi645/gists{/gist_id}","starred_url":"https://api.github.com/users/shahi645/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shahi645/subscriptions","organizations_url":"https://api.github.com/users/shahi645/orgs","repos_url":"https://api.github.com/users/shahi645/repos","events_url":"https://api.github.com/users/shahi645/events{/privacy}","received_events_url":"https://api.github.com/users/shahi645/received_events","type":"User","site_admin":false},"body":" - Reformat image to make answers more prominent","created_at":"2017-05-09T14:19:48Z","updated_at":"2017-05-10T10:40:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37ed4ca1f8804027e5a01e6ca8637991aa191dc7","assignee":{"login":"shahi645","id":22025926,"avatar_url":"https://avatars3.githubusercontent.com/u/22025926?v=3","gravatar_id":"","url":"https://api.github.com/users/shahi645","html_url":"https://github.com/shahi645","followers_url":"https://api.github.com/users/shahi645/followers","following_url":"https://api.github.com/users/shahi645/following{/other_user}","gists_url":"https://api.github.com/users/shahi645/gists{/gist_id}","starred_url":"https://api.github.com/users/shahi645/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shahi645/subscriptions","organizations_url":"https://api.github.com/users/shahi645/orgs","repos_url":"https://api.github.com/users/shahi645/repos","events_url":"https://api.github.com/users/shahi645/events{/privacy}","received_events_url":"https://api.github.com/users/shahi645/received_events","type":"User","site_admin":false},"assignees":[{"login":"shahi645","id":22025926,"avatar_url":"https://avatars3.githubusercontent.com/u/22025926?v=3","gravatar_id":"","url":"https://api.github.com/users/shahi645","html_url":"https://github.com/shahi645","followers_url":"https://api.github.com/users/shahi645/followers","following_url":"https://api.github.com/users/shahi645/following{/other_user}","gists_url":"https://api.github.com/users/shahi645/gists{/gist_id}","starred_url":"https://api.github.com/users/shahi645/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shahi645/subscriptions","organizations_url":"https://api.github.com/users/shahi645/orgs","repos_url":"https://api.github.com/users/shahi645/repos","events_url":"https://api.github.com/users/shahi645/events{/privacy}","received_events_url":"https://api.github.com/users/shahi645/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/22/commits","review_comments_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/22/comments","review_comment_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues/22/comments","statuses_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/statuses/40c76bcd4615bc19757f7901befbc4594d710401","head":{"label":"ONSdigital:feature/red-answers","ref":"feature/red-answers","sha":"40c76bcd4615bc19757f7901befbc4594d710401","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars3.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":77139544,"name":"sdx-transform-cora","full_name":"ONSdigital/sdx-transform-cora","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars3.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/sdx-transform-cora","description":"SDX Transform service for processing CORA destined survey data","fork":false,"url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora","forks_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/forks","keys_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/teams","hooks_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/events","assignees_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/tags","blobs_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/subscription","commits_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/merges","archive_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/downloads","issues_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/deployments","created_at":"2016-12-22T11:34:35Z","updated_at":"2017-02-14T17:24:43Z","pushed_at":"2017-05-10T10:10:22Z","git_url":"git://github.com/ONSdigital/sdx-transform-cora.git","ssh_url":"git@github.com:ONSdigital/sdx-transform-cora.git","clone_url":"https://github.com/ONSdigital/sdx-transform-cora.git","svn_url":"https://github.com/ONSdigital/sdx-transform-cora","homepage":null,"size":130,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"ONSdigital:develop","ref":"develop","sha":"868b690bd87d006f98a2c3295bec325c07af3371","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars3.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":77139544,"name":"sdx-transform-cora","full_name":"ONSdigital/sdx-transform-cora","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars3.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/sdx-transform-cora","description":"SDX Transform service for processing CORA destined survey data","fork":false,"url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora","forks_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/forks","keys_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/teams","hooks_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/events","assignees_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/tags","blobs_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/subscription","commits_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/merges","archive_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/downloads","issues_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/deployments","created_at":"2016-12-22T11:34:35Z","updated_at":"2017-02-14T17:24:43Z","pushed_at":"2017-05-10T10:10:22Z","git_url":"git://github.com/ONSdigital/sdx-transform-cora.git","ssh_url":"git@github.com:ONSdigital/sdx-transform-cora.git","clone_url":"https://github.com/ONSdigital/sdx-transform-cora.git","svn_url":"https://github.com/ONSdigital/sdx-transform-cora","homepage":null,"size":130,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/22"},"html":{"href":"https://github.com/ONSdigital/sdx-transform-cora/pull/22"},"issue":{"href":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues/22"},"comments":{"href":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/ONSdigital/sdx-transform-cora/statuses/40c76bcd4615bc19757f7901befbc4594d710401"}}}}
{"actor":{"display_login":"shahi645"}}