{"action":"opened","number":263,"pull_request":{"url":"https://api.github.com/repos/codeforamerica/intake/pulls/263","id":101547797,"html_url":"https://github.com/codeforamerica/intake/pull/263","diff_url":"https://github.com/codeforamerica/intake/pull/263.diff","patch_url":"https://github.com/codeforamerica/intake/pull/263.patch","issue_url":"https://api.github.com/repos/codeforamerica/intake/issues/263","number":263,"state":"open","locked":false,"title":"Adjust content for nonlive partners","user":{"login":"bengolder","id":451510,"avatar_url":"https://avatars.githubusercontent.com/u/451510?v=3","gravatar_id":"","url":"https://api.github.com/users/bengolder","html_url":"https://github.com/bengolder","followers_url":"https://api.github.com/users/bengolder/followers","following_url":"https://api.github.com/users/bengolder/following{/other_user}","gists_url":"https://api.github.com/users/bengolder/gists{/gist_id}","starred_url":"https://api.github.com/users/bengolder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengolder/subscriptions","organizations_url":"https://api.github.com/users/bengolder/orgs","repos_url":"https://api.github.com/users/bengolder/repos","events_url":"https://api.github.com/users/bengolder/events{/privacy}","received_events_url":"https://api.github.com/users/bengolder/received_events","type":"User","site_admin":false},"body":"## Problems\r\n\r\n- Counties and organizations appear in seemingly random order. It should be consistent.\r\n- When non-live counties and orgs are loaded to the production site, they are listed under the `/partners/` URL even if they aren't live or listed elsewhere.\r\n\r\n## Problems\r\n- orders counties and organizations alphabetically by default (note: this does not override hardcoded ordering, which has been used in some places)\r\n- only show counties with live organizations and organizations that are live in the partner list. This uses the `is_accepting_applications` flag on the Organization model.\r\n\r\nCounties are filtered based on an aggregation of their constituent organizations' `is_accepting_applications` column:\r\n\r\n```python\r\nmodels.County.objects.annotate(\r\n            live_org_count=Count(\r\n                Case(When(\r\n                    organizations__is_accepting_applications=True, then=1\r\n                ))\r\n            )\r\n).filter(live_org_count__gte=1)\r\n```\r\n\r\n```sql\r\nSELECT\r\n\t\"intake_county\".\"id\",\r\n\t\"intake_county\".\"slug\",\r\n\t\"intake_county\".\"name\",\r\n\t\"intake_county\".\"description\",\r\n\tCOUNT(\r\n\t\tCASE WHEN\r\n\t\t\t\"user_accounts_organization\".\"is_accepting_applications\" = true\r\n\t\t\tTHEN 1 ELSE NULL END\r\n\t\t) AS \"live_org_count\"\r\nFROM \"intake_county\"\r\n\tLEFT OUTER JOIN \"user_accounts_organization\" ON (\r\n\t\t\"intake_county\".\"id\" = \"user_accounts_organization\".\"county_id\")\r\nGROUP BY \"intake_county\".\"id\"\r\nHAVING\r\n\tCOUNT(\r\n\t\tCASE WHEN\r\n\t\t\t\"user_accounts_organization\".\"is_accepting_applications\" = true\r\n\t\t\tTHEN 1 ELSE NULL END\r\n\t\t) >= 1\r\nORDER BY \"intake_county\".\"name\" ASC\r\n```\r\n","created_at":"2017-01-14T03:05:17Z","updated_at":"2017-01-14T03:05:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/codeforamerica/intake/pulls/263/commits","review_comments_url":"https://api.github.com/repos/codeforamerica/intake/pulls/263/comments","review_comment_url":"https://api.github.com/repos/codeforamerica/intake/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codeforamerica/intake/issues/263/comments","statuses_url":"https://api.github.com/repos/codeforamerica/intake/statuses/00e9dadc9a5f32f8f9315aeb25021d7c715c4c3f","head":{"label":"codeforamerica:adjust-content-for-nonlive-partners","ref":"adjust-content-for-nonlive-partners","sha":"00e9dadc9a5f32f8f9315aeb25021d7c715c4c3f","user":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"repo":{"id":57333621,"name":"intake","full_name":"codeforamerica/intake","owner":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeforamerica/intake","description":"A Django app behind the Clear My Record website","fork":false,"url":"https://api.github.com/repos/codeforamerica/intake","forks_url":"https://api.github.com/repos/codeforamerica/intake/forks","keys_url":"https://api.github.com/repos/codeforamerica/intake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeforamerica/intake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeforamerica/intake/teams","hooks_url":"https://api.github.com/repos/codeforamerica/intake/hooks","issue_events_url":"https://api.github.com/repos/codeforamerica/intake/issues/events{/number}","events_url":"https://api.github.com/repos/codeforamerica/intake/events","assignees_url":"https://api.github.com/repos/codeforamerica/intake/assignees{/user}","branches_url":"https://api.github.com/repos/codeforamerica/intake/branches{/branch}","tags_url":"https://api.github.com/repos/codeforamerica/intake/tags","blobs_url":"https://api.github.com/repos/codeforamerica/intake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeforamerica/intake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeforamerica/intake/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeforamerica/intake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeforamerica/intake/statuses/{sha}","languages_url":"https://api.github.com/repos/codeforamerica/intake/languages","stargazers_url":"https://api.github.com/repos/codeforamerica/intake/stargazers","contributors_url":"https://api.github.com/repos/codeforamerica/intake/contributors","subscribers_url":"https://api.github.com/repos/codeforamerica/intake/subscribers","subscription_url":"https://api.github.com/repos/codeforamerica/intake/subscription","commits_url":"https://api.github.com/repos/codeforamerica/intake/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeforamerica/intake/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeforamerica/intake/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeforamerica/intake/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeforamerica/intake/contents/{+path}","compare_url":"https://api.github.com/repos/codeforamerica/intake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeforamerica/intake/merges","archive_url":"https://api.github.com/repos/codeforamerica/intake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeforamerica/intake/downloads","issues_url":"https://api.github.com/repos/codeforamerica/intake/issues{/number}","pulls_url":"https://api.github.com/repos/codeforamerica/intake/pulls{/number}","milestones_url":"https://api.github.com/repos/codeforamerica/intake/milestones{/number}","notifications_url":"https://api.github.com/repos/codeforamerica/intake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeforamerica/intake/labels{/name}","releases_url":"https://api.github.com/repos/codeforamerica/intake/releases{/id}","deployments_url":"https://api.github.com/repos/codeforamerica/intake/deployments","created_at":"2016-04-28T21:03:55Z","updated_at":"2016-12-03T21:27:47Z","pushed_at":"2017-01-14T02:56:21Z","git_url":"git://github.com/codeforamerica/intake.git","ssh_url":"git@github.com:codeforamerica/intake.git","clone_url":"https://github.com/codeforamerica/intake.git","svn_url":"https://github.com/codeforamerica/intake","homepage":"https://clearmyrecord.codeforamerica.org","size":90699,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":89,"forks":4,"open_issues":89,"watchers":3,"default_branch":"master"}},"base":{"label":"codeforamerica:master","ref":"master","sha":"d75a06364cb8413691990660cc76f47c65a7ae13","user":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"repo":{"id":57333621,"name":"intake","full_name":"codeforamerica/intake","owner":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeforamerica/intake","description":"A Django app behind the Clear My Record website","fork":false,"url":"https://api.github.com/repos/codeforamerica/intake","forks_url":"https://api.github.com/repos/codeforamerica/intake/forks","keys_url":"https://api.github.com/repos/codeforamerica/intake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeforamerica/intake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeforamerica/intake/teams","hooks_url":"https://api.github.com/repos/codeforamerica/intake/hooks","issue_events_url":"https://api.github.com/repos/codeforamerica/intake/issues/events{/number}","events_url":"https://api.github.com/repos/codeforamerica/intake/events","assignees_url":"https://api.github.com/repos/codeforamerica/intake/assignees{/user}","branches_url":"https://api.github.com/repos/codeforamerica/intake/branches{/branch}","tags_url":"https://api.github.com/repos/codeforamerica/intake/tags","blobs_url":"https://api.github.com/repos/codeforamerica/intake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeforamerica/intake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeforamerica/intake/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeforamerica/intake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeforamerica/intake/statuses/{sha}","languages_url":"https://api.github.com/repos/codeforamerica/intake/languages","stargazers_url":"https://api.github.com/repos/codeforamerica/intake/stargazers","contributors_url":"https://api.github.com/repos/codeforamerica/intake/contributors","subscribers_url":"https://api.github.com/repos/codeforamerica/intake/subscribers","subscription_url":"https://api.github.com/repos/codeforamerica/intake/subscription","commits_url":"https://api.github.com/repos/codeforamerica/intake/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeforamerica/intake/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeforamerica/intake/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeforamerica/intake/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeforamerica/intake/contents/{+path}","compare_url":"https://api.github.com/repos/codeforamerica/intake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeforamerica/intake/merges","archive_url":"https://api.github.com/repos/codeforamerica/intake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeforamerica/intake/downloads","issues_url":"https://api.github.com/repos/codeforamerica/intake/issues{/number}","pulls_url":"https://api.github.com/repos/codeforamerica/intake/pulls{/number}","milestones_url":"https://api.github.com/repos/codeforamerica/intake/milestones{/number}","notifications_url":"https://api.github.com/repos/codeforamerica/intake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeforamerica/intake/labels{/name}","releases_url":"https://api.github.com/repos/codeforamerica/intake/releases{/id}","deployments_url":"https://api.github.com/repos/codeforamerica/intake/deployments","created_at":"2016-04-28T21:03:55Z","updated_at":"2016-12-03T21:27:47Z","pushed_at":"2017-01-14T02:56:21Z","git_url":"git://github.com/codeforamerica/intake.git","ssh_url":"git@github.com:codeforamerica/intake.git","clone_url":"https://github.com/codeforamerica/intake.git","svn_url":"https://github.com/codeforamerica/intake","homepage":"https://clearmyrecord.codeforamerica.org","size":90699,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":89,"forks":4,"open_issues":89,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codeforamerica/intake/pulls/263"},"html":{"href":"https://github.com/codeforamerica/intake/pull/263"},"issue":{"href":"https://api.github.com/repos/codeforamerica/intake/issues/263"},"comments":{"href":"https://api.github.com/repos/codeforamerica/intake/issues/263/comments"},"review_comments":{"href":"https://api.github.com/repos/codeforamerica/intake/pulls/263/comments"},"review_comment":{"href":"https://api.github.com/repos/codeforamerica/intake/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codeforamerica/intake/pulls/263/commits"},"statuses":{"href":"https://api.github.com/repos/codeforamerica/intake/statuses/00e9dadc9a5f32f8f9315aeb25021d7c715c4c3f"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":44,"deletions":5,"changed_files":5}}
{"actor":{"display_login":"bengolder"}}