{"action":"created","issue":{"url":"https://api.github.com/repos/mysociety/alaveteli/issues/2166","labels_url":"https://api.github.com/repos/mysociety/alaveteli/issues/2166/labels{/name}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/issues/2166/comments","events_url":"https://api.github.com/repos/mysociety/alaveteli/issues/2166/events","html_url":"https://github.com/mysociety/alaveteli/pull/2166","id":57780348,"number":2166,"title":"Display translations on failed validation","user":{"login":"garethrees","id":282788,"avatar_url":"https://avatars.githubusercontent.com/u/282788?v=3","gravatar_id":"","url":"https://api.github.com/users/garethrees","html_url":"https://github.com/garethrees","followers_url":"https://api.github.com/users/garethrees/followers","following_url":"https://api.github.com/users/garethrees/following{/other_user}","gists_url":"https://api.github.com/users/garethrees/gists{/gist_id}","starred_url":"https://api.github.com/users/garethrees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethrees/subscriptions","organizations_url":"https://api.github.com/users/garethrees/orgs","repos_url":"https://api.github.com/users/garethrees/repos","events_url":"https://api.github.com/users/garethrees/events{/privacy}","received_events_url":"https://api.github.com/users/garethrees/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mysociety/alaveteli/labels/3%20-%20current%20sprint","name":"3 - current sprint","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-16T09:15:53Z","updated_at":"2015-02-18T10:21:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mysociety/alaveteli/pulls/2166","html_url":"https://github.com/mysociety/alaveteli/pull/2166","diff_url":"https://github.com/mysociety/alaveteli/pull/2166.diff","patch_url":"https://github.com/mysociety/alaveteli/pull/2166.patch"},"body":"**HOTFIX** (Moved from #2154)\r\n\r\nac907d7 built the translations in the controller rather than the view.\r\n\r\nIn a request that contains no params for a translation and fails\r\nvalidation the translation is no longer available to the view. This\r\ncommit builds the translations in the case of a failed validation.\r\n\r\nFixes issue brought up in https://github.com/mysociety/alaveteli/pull/2140#issuecomment-73094018\r\n\r\n<!---\r\n@huboard:{\"order\":0.07037366926670074}\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/mysociety/alaveteli/issues/comments/74841964","html_url":"https://github.com/mysociety/alaveteli/pull/2166#issuecomment-74841964","issue_url":"https://api.github.com/repos/mysociety/alaveteli/issues/2166","id":74841964,"user":{"login":"garethrees","id":282788,"avatar_url":"https://avatars.githubusercontent.com/u/282788?v=3","gravatar_id":"","url":"https://api.github.com/users/garethrees","html_url":"https://github.com/garethrees","followers_url":"https://api.github.com/users/garethrees/followers","following_url":"https://api.github.com/users/garethrees/following{/other_user}","gists_url":"https://api.github.com/users/garethrees/gists{/gist_id}","starred_url":"https://api.github.com/users/garethrees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethrees/subscriptions","organizations_url":"https://api.github.com/users/garethrees/orgs","repos_url":"https://api.github.com/users/garethrees/repos","events_url":"https://api.github.com/users/garethrees/events{/privacy}","received_events_url":"https://api.github.com/users/garethrees/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T10:21:18Z","updated_at":"2015-02-18T10:21:18Z","body":"I think this works in most cases now, but if the `PublicBody` fails validation the `PublicBody::Translation` is persisted without a `public_body_id`. https://github.com/mysociety/alaveteli/pull/2142 should prevent this, so we'll have to include both in the hotfix."}}