{"action":"created","comment":{"url":"https://api.github.com/repos/uktrade/directory-sso/pulls/comments/84938743","pull_request_review_id":5684444,"id":84938743,"diff_hunk":"@@ -0,0 +1,11 @@\n+class FormCssErrorClassMiddleware:\n+    \"\"\"\n+    Django provides no nice way to set `error_css_class` on all forms,\n+    so we do it here.\n+\n+    \"\"\"\n+    def process_template_response(self, request, response):\n+        form = response.context_data.get('form')\n+        if form:\n+            form.error_css_class = 'input-field-container has-error'","path":"sso/middleware.py","position":10,"original_position":10,"commit_id":"f788e70d3d40a0331d677b45b4f71afac5487ddd","original_commit_id":"f788e70d3d40a0331d677b45b4f71afac5487ddd","user":{"login":"richtier","id":5485798,"avatar_url":"https://avatars.githubusercontent.com/u/5485798?v=3","gravatar_id":"","url":"https://api.github.com/users/richtier","html_url":"https://github.com/richtier","followers_url":"https://api.github.com/users/richtier/followers","following_url":"https://api.github.com/users/richtier/following{/other_user}","gists_url":"https://api.github.com/users/richtier/gists{/gist_id}","starred_url":"https://api.github.com/users/richtier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richtier/subscriptions","organizations_url":"https://api.github.com/users/richtier/orgs","repos_url":"https://api.github.com/users/richtier/repos","events_url":"https://api.github.com/users/richtier/events{/privacy}","received_events_url":"https://api.github.com/users/richtier/received_events","type":"User","site_admin":false},"body":"yes, this is horrible :(\r\n\r\n@konradko @monikasulik are you aware of a way to add an arbitrary property to every form in the project without being able to edit the source code of said forms?\r\n\r\nThe reason we want `error_css_class` is if the form has `error_css_class` then it will add that class to the fields that have errors when rendering - which results in the inset red lined field.\r\n\r\nThe reason we cant add the property to the form source code is the forms are provided by allauth library, so without forking we cant edit the source code.","created_at":"2016-10-25T16:02:53Z","updated_at":"2016-10-25T16:02:53Z","html_url":"https://github.com/uktrade/directory-sso/pull/2#discussion_r84938743","pull_request_url":"https://api.github.com/repos/uktrade/directory-sso/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/uktrade/directory-sso/pulls/comments/84938743"},"html":{"href":"https://github.com/uktrade/directory-sso/pull/2#discussion_r84938743"},"pull_request":{"href":"https://api.github.com/repos/uktrade/directory-sso/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/uktrade/directory-sso/pulls/2","id":90838304,"html_url":"https://github.com/uktrade/directory-sso/pull/2","diff_url":"https://github.com/uktrade/directory-sso/pull/2.diff","patch_url":"https://github.com/uktrade/directory-sso/pull/2.patch","issue_url":"https://api.github.com/repos/uktrade/directory-sso/issues/2","number":2,"state":"open","locked":false,"title":"Style form template","user":{"login":"richtier","id":5485798,"avatar_url":"https://avatars.githubusercontent.com/u/5485798?v=3","gravatar_id":"","url":"https://api.github.com/users/richtier","html_url":"https://github.com/richtier","followers_url":"https://api.github.com/users/richtier/followers","following_url":"https://api.github.com/users/richtier/following{/other_user}","gists_url":"https://api.github.com/users/richtier/gists{/gist_id}","starred_url":"https://api.github.com/users/richtier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richtier/subscriptions","organizations_url":"https://api.github.com/users/richtier/orgs","repos_url":"https://api.github.com/users/richtier/repos","events_url":"https://api.github.com/users/richtier/events{/privacy}","received_events_url":"https://api.github.com/users/richtier/received_events","type":"User","site_admin":false},"body":"[this task](https://uktrade.atlassian.net/browse/ED-214)\r\n[this task](https://uktrade.atlassian.net/browse/ED-213)\r\n\r\n# Before\r\n![image](https://cloud.githubusercontent.com/assets/5485798/19693484/a77188a8-9ad3-11e6-86d3-9e5342228683.png)\r\n\r\n# After\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5485798/19693516/bf6e7d26-9ad3-11e6-87d6-a41414960147.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5485798/19693495/b5c25a7c-9ad3-11e6-87bc-1e761c9e5c33.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5485798/19693502/bae081be-9ad3-11e6-83a7-470808bfad9b.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5485798/19693522/c4a75632-9ad3-11e6-90f7-8dcf5bd91cf8.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5485798/19693529/ccc996b8-9ad3-11e6-8022-81289fab8d4e.png)\r\n","created_at":"2016-10-25T15:59:05Z","updated_at":"2016-10-25T16:02:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afb29a3752a3a3da809b611b1b13eb2938a5bdc3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/uktrade/directory-sso/pulls/2/commits","review_comments_url":"https://api.github.com/repos/uktrade/directory-sso/pulls/2/comments","review_comment_url":"https://api.github.com/repos/uktrade/directory-sso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uktrade/directory-sso/issues/2/comments","statuses_url":"https://api.github.com/repos/uktrade/directory-sso/statuses/f788e70d3d40a0331d677b45b4f71afac5487ddd","head":{"label":"uktrade:style-soo-forms","ref":"style-soo-forms","sha":"f788e70d3d40a0331d677b45b4f71afac5487ddd","user":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars.githubusercontent.com/u/15107524?v=3","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"repo":{"id":71396361,"name":"directory-sso","full_name":"uktrade/directory-sso","owner":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars.githubusercontent.com/u/15107524?v=3","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uktrade/directory-sso","description":null,"fork":false,"url":"https://api.github.com/repos/uktrade/directory-sso","forks_url":"https://api.github.com/repos/uktrade/directory-sso/forks","keys_url":"https://api.github.com/repos/uktrade/directory-sso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uktrade/directory-sso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uktrade/directory-sso/teams","hooks_url":"https://api.github.com/repos/uktrade/directory-sso/hooks","issue_events_url":"https://api.github.com/repos/uktrade/directory-sso/issues/events{/number}","events_url":"https://api.github.com/repos/uktrade/directory-sso/events","assignees_url":"https://api.github.com/repos/uktrade/directory-sso/assignees{/user}","branches_url":"https://api.github.com/repos/uktrade/directory-sso/branches{/branch}","tags_url":"https://api.github.com/repos/uktrade/directory-sso/tags","blobs_url":"https://api.github.com/repos/uktrade/directory-sso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uktrade/directory-sso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uktrade/directory-sso/git/refs{/sha}","trees_url":"https://api.github.com/repos/uktrade/directory-sso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uktrade/directory-sso/statuses/{sha}","languages_url":"https://api.github.com/repos/uktrade/directory-sso/languages","stargazers_url":"https://api.github.com/repos/uktrade/directory-sso/stargazers","contributors_url":"https://api.github.com/repos/uktrade/directory-sso/contributors","subscribers_url":"https://api.github.com/repos/uktrade/directory-sso/subscribers","subscription_url":"https://api.github.com/repos/uktrade/directory-sso/subscription","commits_url":"https://api.github.com/repos/uktrade/directory-sso/commits{/sha}","git_commits_url":"https://api.github.com/repos/uktrade/directory-sso/git/commits{/sha}","comments_url":"https://api.github.com/repos/uktrade/directory-sso/comments{/number}","issue_comment_url":"https://api.github.com/repos/uktrade/directory-sso/issues/comments{/number}","contents_url":"https://api.github.com/repos/uktrade/directory-sso/contents/{+path}","compare_url":"https://api.github.com/repos/uktrade/directory-sso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uktrade/directory-sso/merges","archive_url":"https://api.github.com/repos/uktrade/directory-sso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uktrade/directory-sso/downloads","issues_url":"https://api.github.com/repos/uktrade/directory-sso/issues{/number}","pulls_url":"https://api.github.com/repos/uktrade/directory-sso/pulls{/number}","milestones_url":"https://api.github.com/repos/uktrade/directory-sso/milestones{/number}","notifications_url":"https://api.github.com/repos/uktrade/directory-sso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uktrade/directory-sso/labels{/name}","releases_url":"https://api.github.com/repos/uktrade/directory-sso/releases{/id}","deployments_url":"https://api.github.com/repos/uktrade/directory-sso/deployments","created_at":"2016-10-19T20:25:54Z","updated_at":"2016-10-23T21:02:15Z","pushed_at":"2016-10-25T15:59:05Z","git_url":"git://github.com/uktrade/directory-sso.git","ssh_url":"git@github.com:uktrade/directory-sso.git","clone_url":"https://github.com/uktrade/directory-sso.git","svn_url":"https://github.com/uktrade/directory-sso","homepage":null,"size":30,"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":"uktrade:master","ref":"master","sha":"e72b687e082c7171aa348af347060cda576da073","user":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars.githubusercontent.com/u/15107524?v=3","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"repo":{"id":71396361,"name":"directory-sso","full_name":"uktrade/directory-sso","owner":{"login":"uktrade","id":15107524,"avatar_url":"https://avatars.githubusercontent.com/u/15107524?v=3","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uktrade/directory-sso","description":null,"fork":false,"url":"https://api.github.com/repos/uktrade/directory-sso","forks_url":"https://api.github.com/repos/uktrade/directory-sso/forks","keys_url":"https://api.github.com/repos/uktrade/directory-sso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uktrade/directory-sso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uktrade/directory-sso/teams","hooks_url":"https://api.github.com/repos/uktrade/directory-sso/hooks","issue_events_url":"https://api.github.com/repos/uktrade/directory-sso/issues/events{/number}","events_url":"https://api.github.com/repos/uktrade/directory-sso/events","assignees_url":"https://api.github.com/repos/uktrade/directory-sso/assignees{/user}","branches_url":"https://api.github.com/repos/uktrade/directory-sso/branches{/branch}","tags_url":"https://api.github.com/repos/uktrade/directory-sso/tags","blobs_url":"https://api.github.com/repos/uktrade/directory-sso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uktrade/directory-sso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uktrade/directory-sso/git/refs{/sha}","trees_url":"https://api.github.com/repos/uktrade/directory-sso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uktrade/directory-sso/statuses/{sha}","languages_url":"https://api.github.com/repos/uktrade/directory-sso/languages","stargazers_url":"https://api.github.com/repos/uktrade/directory-sso/stargazers","contributors_url":"https://api.github.com/repos/uktrade/directory-sso/contributors","subscribers_url":"https://api.github.com/repos/uktrade/directory-sso/subscribers","subscription_url":"https://api.github.com/repos/uktrade/directory-sso/subscription","commits_url":"https://api.github.com/repos/uktrade/directory-sso/commits{/sha}","git_commits_url":"https://api.github.com/repos/uktrade/directory-sso/git/commits{/sha}","comments_url":"https://api.github.com/repos/uktrade/directory-sso/comments{/number}","issue_comment_url":"https://api.github.com/repos/uktrade/directory-sso/issues/comments{/number}","contents_url":"https://api.github.com/repos/uktrade/directory-sso/contents/{+path}","compare_url":"https://api.github.com/repos/uktrade/directory-sso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uktrade/directory-sso/merges","archive_url":"https://api.github.com/repos/uktrade/directory-sso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uktrade/directory-sso/downloads","issues_url":"https://api.github.com/repos/uktrade/directory-sso/issues{/number}","pulls_url":"https://api.github.com/repos/uktrade/directory-sso/pulls{/number}","milestones_url":"https://api.github.com/repos/uktrade/directory-sso/milestones{/number}","notifications_url":"https://api.github.com/repos/uktrade/directory-sso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uktrade/directory-sso/labels{/name}","releases_url":"https://api.github.com/repos/uktrade/directory-sso/releases{/id}","deployments_url":"https://api.github.com/repos/uktrade/directory-sso/deployments","created_at":"2016-10-19T20:25:54Z","updated_at":"2016-10-23T21:02:15Z","pushed_at":"2016-10-25T15:59:05Z","git_url":"git://github.com/uktrade/directory-sso.git","ssh_url":"git@github.com:uktrade/directory-sso.git","clone_url":"https://github.com/uktrade/directory-sso.git","svn_url":"https://github.com/uktrade/directory-sso","homepage":null,"size":30,"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/uktrade/directory-sso/pulls/2"},"html":{"href":"https://github.com/uktrade/directory-sso/pull/2"},"issue":{"href":"https://api.github.com/repos/uktrade/directory-sso/issues/2"},"comments":{"href":"https://api.github.com/repos/uktrade/directory-sso/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/uktrade/directory-sso/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/uktrade/directory-sso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uktrade/directory-sso/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/uktrade/directory-sso/statuses/f788e70d3d40a0331d677b45b4f71afac5487ddd"}}}}
{"actor":{"display_login":"richtier"}}