{"action":"created","comment":{"url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/comments/29713948","id":29713948,"diff_hunk":"@@ -0,0 +1,29 @@\n+from marshmallow import Schema, fields\n+from flask import url_for\n+\n+\n+class CommitteeSchema(Schema):\n+    \"\"\" Defines a schema for committee.\n+    \"\"\"\n+    url = fields.Function(lambda x: url_for('committee_page', c_id=x['committee_id']))\n+    is_primary = fields.Function(lambda x: x['designation'] == 'P')\n+    is_authorized = fields.Function(lambda x: x['designation'] == 'A')\n+    is_joint = fields.Function(lambda x: x['designation'] == 'J')\n+    is_leadership = fields.Function(lambda x: x['designation'] == 'D')\n+    street_2 = fields.Str(allow_none=True)\n+    organization_type = fields.Str(allow_none=True)\n+    organization_type_full = fields.Str(allow_none=True)\n+    party = fields.Str(allow_none=True)\n+    party_full = fields.Str(allow_none=True)\n+\n+    class Meta:\n+        additional = (\n+            'committee_id', 'name', 'committee_type', 'committee_type_full', \n+            'treasurer_name', 'designation', 'designation_full',\n+            'treasurer_name', 'street_1', 'city', 'state', 'zip'\n+        )\n+\n+\n+@CommitteeSchema.error_handler\n+def handle_committee_errors(schema, errors, obj):\n+    raise ValueError('An error occurred:\\n{} \\n\\n...while marshalling the data:\\n{}\\n\\n...for schema: {}'.format(errors, obj, schema))","path":"openfecwebapp/models/committees.py","position":29,"original_position":29,"commit_id":"e28e4a0e4fbc266fe6d3909e93b6be9836d1ddf0","original_commit_id":"e28e4a0e4fbc266fe6d3909e93b6be9836d1ddf0","user":{"login":"arowla","id":166715,"avatar_url":"https://avatars.githubusercontent.com/u/166715?v=3","gravatar_id":"","url":"https://api.github.com/users/arowla","html_url":"https://github.com/arowla","followers_url":"https://api.github.com/users/arowla/followers","following_url":"https://api.github.com/users/arowla/following{/other_user}","gists_url":"https://api.github.com/users/arowla/gists{/gist_id}","starred_url":"https://api.github.com/users/arowla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arowla/subscriptions","organizations_url":"https://api.github.com/users/arowla/orgs","repos_url":"https://api.github.com/users/arowla/repos","events_url":"https://api.github.com/users/arowla/events{/privacy}","received_events_url":"https://api.github.com/users/arowla/received_events","type":"User","site_admin":false},"body":"Originally I wasn't using `strict`, and it was failing silently. But this\nprobably isn't needed now that `strict` is turned on.\n\nOn Tue, May 5, 2015 at 5:10 PM, Joshua Carp <notifications@github.com>\nwrote:\n\n> In openfecwebapp/models/committees.py\n> <https://github.com/18F/openFEC-web-app/pull/104#discussion_r29713320>:\n>\n> > +    organization_type = fields.Str(allow_none=True)\n> > +    organization_type_full = fields.Str(allow_none=True)\n> > +    party = fields.Str(allow_none=True)\n> > +    party_full = fields.Str(allow_none=True)\n> > +\n> > +    class Meta:\n> > +        additional = (\n> > +            'committee_id', 'name', 'committee_type', 'committee_type_full',\n> > +            'treasurer_name', 'designation', 'designation_full',\n> > +            'treasurer_name', 'street_1', 'city', 'state', 'zip'\n> > +        )\n> > +\n> > +\n> > +@CommitteeSchema.error_handler\n> > +def handle_committee_errors(schema, errors, obj):\n> > +    raise ValueError('An error occurred:\\n{} \\n\\n...while marshalling the data:\\n{}\\n\\n...for schema: {}'.format(errors, obj, schema))\n>\n> Not sure what raising a ValueError instead of the default ValidationError\n> buys us. Both will raise a 500 in the app and throw a reasonable-looking\n> traceback. If we want to throw a non-500 error on invalid data, we could\n> call abort here instead.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/18F/openFEC-web-app/pull/104/files#r29713320>.\n>\n\n\n\n-- \nAlison Rowland\nTechnical Lead, https://fbopen.gsa.gov | 18F\n202-317-0124\n","created_at":"2015-05-05T21:15:49Z","updated_at":"2015-05-05T21:15:49Z","html_url":"https://github.com/18F/openFEC-web-app/pull/104#discussion_r29713948","pull_request_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/104","_links":{"self":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/comments/29713948"},"html":{"href":"https://github.com/18F/openFEC-web-app/pull/104#discussion_r29713948"},"pull_request":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/104","id":34327997,"html_url":"https://github.com/18F/openFEC-web-app/pull/104","diff_url":"https://github.com/18F/openFEC-web-app/pull/104.diff","patch_url":"https://github.com/18F/openFEC-web-app/pull/104.patch","issue_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/104","number":104,"state":"open","locked":false,"title":"Unembedded resources (from API refactor)","user":{"login":"arowla","id":166715,"avatar_url":"https://avatars.githubusercontent.com/u/166715?v=3","gravatar_id":"","url":"https://api.github.com/users/arowla","html_url":"https://github.com/arowla","followers_url":"https://api.github.com/users/arowla/followers","following_url":"https://api.github.com/users/arowla/following{/other_user}","gists_url":"https://api.github.com/users/arowla/gists{/gist_id}","starred_url":"https://api.github.com/users/arowla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arowla/subscriptions","organizations_url":"https://api.github.com/users/arowla/orgs","repos_url":"https://api.github.com/users/arowla/repos","events_url":"https://api.github.com/users/arowla/events{/privacy}","received_events_url":"https://api.github.com/users/arowla/received_events","type":"User","site_admin":false},"body":"Known issues:\r\n- Candidate pages may show multiple primary committees\r\n- Financials (totals/reports) are not ready","created_at":"2015-04-29T01:46:37Z","updated_at":"2015-05-05T21:15:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1bc4a06fbafe678493a657109f7494e1a4848213","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/104/commits","review_comments_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/104/comments","review_comment_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/104/comments","statuses_url":"https://api.github.com/repos/18F/openFEC-web-app/statuses/e28e4a0e4fbc266fe6d3909e93b6be9836d1ddf0","head":{"label":"18F:feature/unembed-resources","ref":"feature/unembed-resources","sha":"e28e4a0e4fbc266fe6d3909e93b6be9836d1ddf0","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":25273785,"name":"openFEC-web-app","full_name":"18F/openFEC-web-app","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/openFEC-web-app","description":"Server- and client-side web application for the OpenFEC data site.","fork":false,"url":"https://api.github.com/repos/18F/openFEC-web-app","forks_url":"https://api.github.com/repos/18F/openFEC-web-app/forks","keys_url":"https://api.github.com/repos/18F/openFEC-web-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/openFEC-web-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/openFEC-web-app/teams","hooks_url":"https://api.github.com/repos/18F/openFEC-web-app/hooks","issue_events_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/events{/number}","events_url":"https://api.github.com/repos/18F/openFEC-web-app/events","assignees_url":"https://api.github.com/repos/18F/openFEC-web-app/assignees{/user}","branches_url":"https://api.github.com/repos/18F/openFEC-web-app/branches{/branch}","tags_url":"https://api.github.com/repos/18F/openFEC-web-app/tags","blobs_url":"https://api.github.com/repos/18F/openFEC-web-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/openFEC-web-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/openFEC-web-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/openFEC-web-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/openFEC-web-app/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/openFEC-web-app/languages","stargazers_url":"https://api.github.com/repos/18F/openFEC-web-app/stargazers","contributors_url":"https://api.github.com/repos/18F/openFEC-web-app/contributors","subscribers_url":"https://api.github.com/repos/18F/openFEC-web-app/subscribers","subscription_url":"https://api.github.com/repos/18F/openFEC-web-app/subscription","commits_url":"https://api.github.com/repos/18F/openFEC-web-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/openFEC-web-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/openFEC-web-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/openFEC-web-app/contents/{+path}","compare_url":"https://api.github.com/repos/18F/openFEC-web-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/openFEC-web-app/merges","archive_url":"https://api.github.com/repos/18F/openFEC-web-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/openFEC-web-app/downloads","issues_url":"https://api.github.com/repos/18F/openFEC-web-app/issues{/number}","pulls_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/openFEC-web-app/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/openFEC-web-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/openFEC-web-app/labels{/name}","releases_url":"https://api.github.com/repos/18F/openFEC-web-app/releases{/id}","created_at":"2014-10-15T21:12:32Z","updated_at":"2015-05-05T18:26:23Z","pushed_at":"2015-05-05T19:31:39Z","git_url":"git://github.com/18F/openFEC-web-app.git","ssh_url":"git@github.com:18F/openFEC-web-app.git","clone_url":"https://github.com/18F/openFEC-web-app.git","svn_url":"https://github.com/18F/openFEC-web-app","homepage":"","size":9937,"stargazers_count":7,"watchers_count":7,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":7,"default_branch":"develop"}},"base":{"label":"18F:develop","ref":"develop","sha":"619ce063e112c19125cae2da94660961f958aced","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":25273785,"name":"openFEC-web-app","full_name":"18F/openFEC-web-app","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/openFEC-web-app","description":"Server- and client-side web application for the OpenFEC data site.","fork":false,"url":"https://api.github.com/repos/18F/openFEC-web-app","forks_url":"https://api.github.com/repos/18F/openFEC-web-app/forks","keys_url":"https://api.github.com/repos/18F/openFEC-web-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/openFEC-web-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/openFEC-web-app/teams","hooks_url":"https://api.github.com/repos/18F/openFEC-web-app/hooks","issue_events_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/events{/number}","events_url":"https://api.github.com/repos/18F/openFEC-web-app/events","assignees_url":"https://api.github.com/repos/18F/openFEC-web-app/assignees{/user}","branches_url":"https://api.github.com/repos/18F/openFEC-web-app/branches{/branch}","tags_url":"https://api.github.com/repos/18F/openFEC-web-app/tags","blobs_url":"https://api.github.com/repos/18F/openFEC-web-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/openFEC-web-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/openFEC-web-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/openFEC-web-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/openFEC-web-app/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/openFEC-web-app/languages","stargazers_url":"https://api.github.com/repos/18F/openFEC-web-app/stargazers","contributors_url":"https://api.github.com/repos/18F/openFEC-web-app/contributors","subscribers_url":"https://api.github.com/repos/18F/openFEC-web-app/subscribers","subscription_url":"https://api.github.com/repos/18F/openFEC-web-app/subscription","commits_url":"https://api.github.com/repos/18F/openFEC-web-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/openFEC-web-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/openFEC-web-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/openFEC-web-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/openFEC-web-app/contents/{+path}","compare_url":"https://api.github.com/repos/18F/openFEC-web-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/openFEC-web-app/merges","archive_url":"https://api.github.com/repos/18F/openFEC-web-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/openFEC-web-app/downloads","issues_url":"https://api.github.com/repos/18F/openFEC-web-app/issues{/number}","pulls_url":"https://api.github.com/repos/18F/openFEC-web-app/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/openFEC-web-app/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/openFEC-web-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/openFEC-web-app/labels{/name}","releases_url":"https://api.github.com/repos/18F/openFEC-web-app/releases{/id}","created_at":"2014-10-15T21:12:32Z","updated_at":"2015-05-05T18:26:23Z","pushed_at":"2015-05-05T19:31:39Z","git_url":"git://github.com/18F/openFEC-web-app.git","ssh_url":"git@github.com:18F/openFEC-web-app.git","clone_url":"https://github.com/18F/openFEC-web-app.git","svn_url":"https://github.com/18F/openFEC-web-app","homepage":"","size":9937,"stargazers_count":7,"watchers_count":7,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":7,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/104"},"html":{"href":"https://github.com/18F/openFEC-web-app/pull/104"},"issue":{"href":"https://api.github.com/repos/18F/openFEC-web-app/issues/104"},"comments":{"href":"https://api.github.com/repos/18F/openFEC-web-app/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/openFEC-web-app/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/18F/openFEC-web-app/statuses/e28e4a0e4fbc266fe6d3909e93b6be9836d1ddf0"}}}}