{"action":"created","comment":{"url":"https://api.github.com/repos/15thnight/15thnight/pulls/comments/73265858","id":73265858,"diff_hunk":"@@ -167,21 +138,19 @@ def get_active_alerts_for_provider(cls, user):\n             .filter(cls.created_at > time_to_filter_from)\\\n             .order_by(desc(cls.created_at)) \\\n             .all()\n-        responded_alerts = map(lambda respond: respond.alert_id, Response.query.filter(\n+        responded_alerts = map(\n+            lambda respond: respond.alert_id,\n+            Response.query.filter(\n                 Response.user_id == user.id,\n                 Response.created_at > time_to_filter_from\n-        ))\n+            )\n+        )\n \n         for alert in alerts_past_two_days:\n             if alert.id in responded_alerts:\n                 alerts_past_two_days.remove(alert)\n \n-        for alert in alerts_past_two_days:\n-            if (alert.food and user.food == alert.food) or \\\n-                    (alert.shelter and user.shelter == alert.shelter) or \\\n-                    (alert.clothes and user.clothes == alert.clothes) or \\\n-                    (alert.other and user.other == alert.other):\n-                active_alerts.append(alert)\n+        active_alerts = Alert.query.join(Category).distinct()","path":"_15thnight/models.py","position":147,"original_position":147,"commit_id":"6c15995bebf3e08cd8dc74e8752b455f3ee815ab","original_commit_id":"6c15995bebf3e08cd8dc74e8752b455f3ee815ab","user":{"login":"spectralsun","id":2507359,"avatar_url":"https://avatars.githubusercontent.com/u/2507359?v=3","gravatar_id":"","url":"https://api.github.com/users/spectralsun","html_url":"https://github.com/spectralsun","followers_url":"https://api.github.com/users/spectralsun/followers","following_url":"https://api.github.com/users/spectralsun/following{/other_user}","gists_url":"https://api.github.com/users/spectralsun/gists{/gist_id}","starred_url":"https://api.github.com/users/spectralsun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spectralsun/subscriptions","organizations_url":"https://api.github.com/users/spectralsun/orgs","repos_url":"https://api.github.com/users/spectralsun/repos","events_url":"https://api.github.com/users/spectralsun/events{/privacy}","received_events_url":"https://api.github.com/users/spectralsun/received_events","type":"User","site_admin":false},"body":"Let's put this in a method on the model.","created_at":"2016-08-03T01:03:49Z","updated_at":"2016-08-03T01:03:49Z","html_url":"https://github.com/15thnight/15thnight/pull/87#discussion_r73265858","pull_request_url":"https://api.github.com/repos/15thnight/15thnight/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/15thnight/15thnight/pulls/comments/73265858"},"html":{"href":"https://github.com/15thnight/15thnight/pull/87#discussion_r73265858"},"pull_request":{"href":"https://api.github.com/repos/15thnight/15thnight/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/15thnight/15thnight/pulls/87","id":79828306,"html_url":"https://github.com/15thnight/15thnight/pull/87","diff_url":"https://github.com/15thnight/15thnight/pull/87.diff","patch_url":"https://github.com/15thnight/15thnight/pull/87.patch","issue_url":"https://api.github.com/repos/15thnight/15thnight/issues/87","number":87,"state":"open","locked":false,"title":"Categories API","user":{"login":"justinnoah","id":443413,"avatar_url":"https://avatars.githubusercontent.com/u/443413?v=3","gravatar_id":"","url":"https://api.github.com/users/justinnoah","html_url":"https://github.com/justinnoah","followers_url":"https://api.github.com/users/justinnoah/followers","following_url":"https://api.github.com/users/justinnoah/following{/other_user}","gists_url":"https://api.github.com/users/justinnoah/gists{/gist_id}","starred_url":"https://api.github.com/users/justinnoah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinnoah/subscriptions","organizations_url":"https://api.github.com/users/justinnoah/orgs","repos_url":"https://api.github.com/users/justinnoah/repos","events_url":"https://api.github.com/users/justinnoah/events{/privacy}","received_events_url":"https://api.github.com/users/justinnoah/received_events","type":"User","site_admin":false},"body":"Can now add/edit/delete/view categories as API calls where permissible.","created_at":"2016-08-02T23:52:01Z","updated_at":"2016-08-03T01:03:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e4d270bde490ea89973d7a5d01329f24f362253","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/15thnight/15thnight/pulls/87/commits","review_comments_url":"https://api.github.com/repos/15thnight/15thnight/pulls/87/comments","review_comment_url":"https://api.github.com/repos/15thnight/15thnight/pulls/comments{/number}","comments_url":"https://api.github.com/repos/15thnight/15thnight/issues/87/comments","statuses_url":"https://api.github.com/repos/15thnight/15thnight/statuses/6c15995bebf3e08cd8dc74e8752b455f3ee815ab","head":{"label":"justinnoah:api_categories","ref":"api_categories","sha":"6c15995bebf3e08cd8dc74e8752b455f3ee815ab","user":{"login":"justinnoah","id":443413,"avatar_url":"https://avatars.githubusercontent.com/u/443413?v=3","gravatar_id":"","url":"https://api.github.com/users/justinnoah","html_url":"https://github.com/justinnoah","followers_url":"https://api.github.com/users/justinnoah/followers","following_url":"https://api.github.com/users/justinnoah/following{/other_user}","gists_url":"https://api.github.com/users/justinnoah/gists{/gist_id}","starred_url":"https://api.github.com/users/justinnoah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinnoah/subscriptions","organizations_url":"https://api.github.com/users/justinnoah/orgs","repos_url":"https://api.github.com/users/justinnoah/repos","events_url":"https://api.github.com/users/justinnoah/events{/privacy}","received_events_url":"https://api.github.com/users/justinnoah/received_events","type":"User","site_admin":false},"repo":{"id":51654389,"name":"15thnight","full_name":"justinnoah/15thnight","owner":{"login":"justinnoah","id":443413,"avatar_url":"https://avatars.githubusercontent.com/u/443413?v=3","gravatar_id":"","url":"https://api.github.com/users/justinnoah","html_url":"https://github.com/justinnoah","followers_url":"https://api.github.com/users/justinnoah/followers","following_url":"https://api.github.com/users/justinnoah/following{/other_user}","gists_url":"https://api.github.com/users/justinnoah/gists{/gist_id}","starred_url":"https://api.github.com/users/justinnoah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinnoah/subscriptions","organizations_url":"https://api.github.com/users/justinnoah/orgs","repos_url":"https://api.github.com/users/justinnoah/repos","events_url":"https://api.github.com/users/justinnoah/events{/privacy}","received_events_url":"https://api.github.com/users/justinnoah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/justinnoah/15thnight","description":"15th Night App","fork":true,"url":"https://api.github.com/repos/justinnoah/15thnight","forks_url":"https://api.github.com/repos/justinnoah/15thnight/forks","keys_url":"https://api.github.com/repos/justinnoah/15thnight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/justinnoah/15thnight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/justinnoah/15thnight/teams","hooks_url":"https://api.github.com/repos/justinnoah/15thnight/hooks","issue_events_url":"https://api.github.com/repos/justinnoah/15thnight/issues/events{/number}","events_url":"https://api.github.com/repos/justinnoah/15thnight/events","assignees_url":"https://api.github.com/repos/justinnoah/15thnight/assignees{/user}","branches_url":"https://api.github.com/repos/justinnoah/15thnight/branches{/branch}","tags_url":"https://api.github.com/repos/justinnoah/15thnight/tags","blobs_url":"https://api.github.com/repos/justinnoah/15thnight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/justinnoah/15thnight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/justinnoah/15thnight/git/refs{/sha}","trees_url":"https://api.github.com/repos/justinnoah/15thnight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/justinnoah/15thnight/statuses/{sha}","languages_url":"https://api.github.com/repos/justinnoah/15thnight/languages","stargazers_url":"https://api.github.com/repos/justinnoah/15thnight/stargazers","contributors_url":"https://api.github.com/repos/justinnoah/15thnight/contributors","subscribers_url":"https://api.github.com/repos/justinnoah/15thnight/subscribers","subscription_url":"https://api.github.com/repos/justinnoah/15thnight/subscription","commits_url":"https://api.github.com/repos/justinnoah/15thnight/commits{/sha}","git_commits_url":"https://api.github.com/repos/justinnoah/15thnight/git/commits{/sha}","comments_url":"https://api.github.com/repos/justinnoah/15thnight/comments{/number}","issue_comment_url":"https://api.github.com/repos/justinnoah/15thnight/issues/comments{/number}","contents_url":"https://api.github.com/repos/justinnoah/15thnight/contents/{+path}","compare_url":"https://api.github.com/repos/justinnoah/15thnight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/justinnoah/15thnight/merges","archive_url":"https://api.github.com/repos/justinnoah/15thnight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/justinnoah/15thnight/downloads","issues_url":"https://api.github.com/repos/justinnoah/15thnight/issues{/number}","pulls_url":"https://api.github.com/repos/justinnoah/15thnight/pulls{/number}","milestones_url":"https://api.github.com/repos/justinnoah/15thnight/milestones{/number}","notifications_url":"https://api.github.com/repos/justinnoah/15thnight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/justinnoah/15thnight/labels{/name}","releases_url":"https://api.github.com/repos/justinnoah/15thnight/releases{/id}","deployments_url":"https://api.github.com/repos/justinnoah/15thnight/deployments","created_at":"2016-02-13T16:38:10Z","updated_at":"2016-07-14T01:39:10Z","pushed_at":"2016-08-02T23:50:28Z","git_url":"git://github.com/justinnoah/15thnight.git","ssh_url":"git@github.com:justinnoah/15thnight.git","clone_url":"https://github.com/justinnoah/15thnight.git","svn_url":"https://github.com/justinnoah/15thnight","homepage":null,"size":415,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"15thnight:develop","ref":"develop","sha":"4d1053c1ad9ab57bbf1efbc9363d1c4f427849ed","user":{"login":"15thnight","id":17213148,"avatar_url":"https://avatars.githubusercontent.com/u/17213148?v=3","gravatar_id":"","url":"https://api.github.com/users/15thnight","html_url":"https://github.com/15thnight","followers_url":"https://api.github.com/users/15thnight/followers","following_url":"https://api.github.com/users/15thnight/following{/other_user}","gists_url":"https://api.github.com/users/15thnight/gists{/gist_id}","starred_url":"https://api.github.com/users/15thnight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/15thnight/subscriptions","organizations_url":"https://api.github.com/users/15thnight/orgs","repos_url":"https://api.github.com/users/15thnight/repos","events_url":"https://api.github.com/users/15thnight/events{/privacy}","received_events_url":"https://api.github.com/users/15thnight/received_events","type":"Organization","site_admin":false},"repo":{"id":51633804,"name":"15thnight","full_name":"15thnight/15thnight","owner":{"login":"15thnight","id":17213148,"avatar_url":"https://avatars.githubusercontent.com/u/17213148?v=3","gravatar_id":"","url":"https://api.github.com/users/15thnight","html_url":"https://github.com/15thnight","followers_url":"https://api.github.com/users/15thnight/followers","following_url":"https://api.github.com/users/15thnight/following{/other_user}","gists_url":"https://api.github.com/users/15thnight/gists{/gist_id}","starred_url":"https://api.github.com/users/15thnight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/15thnight/subscriptions","organizations_url":"https://api.github.com/users/15thnight/orgs","repos_url":"https://api.github.com/users/15thnight/repos","events_url":"https://api.github.com/users/15thnight/events{/privacy}","received_events_url":"https://api.github.com/users/15thnight/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/15thnight/15thnight","description":"15th Night App","fork":false,"url":"https://api.github.com/repos/15thnight/15thnight","forks_url":"https://api.github.com/repos/15thnight/15thnight/forks","keys_url":"https://api.github.com/repos/15thnight/15thnight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/15thnight/15thnight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/15thnight/15thnight/teams","hooks_url":"https://api.github.com/repos/15thnight/15thnight/hooks","issue_events_url":"https://api.github.com/repos/15thnight/15thnight/issues/events{/number}","events_url":"https://api.github.com/repos/15thnight/15thnight/events","assignees_url":"https://api.github.com/repos/15thnight/15thnight/assignees{/user}","branches_url":"https://api.github.com/repos/15thnight/15thnight/branches{/branch}","tags_url":"https://api.github.com/repos/15thnight/15thnight/tags","blobs_url":"https://api.github.com/repos/15thnight/15thnight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/15thnight/15thnight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/15thnight/15thnight/git/refs{/sha}","trees_url":"https://api.github.com/repos/15thnight/15thnight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/15thnight/15thnight/statuses/{sha}","languages_url":"https://api.github.com/repos/15thnight/15thnight/languages","stargazers_url":"https://api.github.com/repos/15thnight/15thnight/stargazers","contributors_url":"https://api.github.com/repos/15thnight/15thnight/contributors","subscribers_url":"https://api.github.com/repos/15thnight/15thnight/subscribers","subscription_url":"https://api.github.com/repos/15thnight/15thnight/subscription","commits_url":"https://api.github.com/repos/15thnight/15thnight/commits{/sha}","git_commits_url":"https://api.github.com/repos/15thnight/15thnight/git/commits{/sha}","comments_url":"https://api.github.com/repos/15thnight/15thnight/comments{/number}","issue_comment_url":"https://api.github.com/repos/15thnight/15thnight/issues/comments{/number}","contents_url":"https://api.github.com/repos/15thnight/15thnight/contents/{+path}","compare_url":"https://api.github.com/repos/15thnight/15thnight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/15thnight/15thnight/merges","archive_url":"https://api.github.com/repos/15thnight/15thnight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/15thnight/15thnight/downloads","issues_url":"https://api.github.com/repos/15thnight/15thnight/issues{/number}","pulls_url":"https://api.github.com/repos/15thnight/15thnight/pulls{/number}","milestones_url":"https://api.github.com/repos/15thnight/15thnight/milestones{/number}","notifications_url":"https://api.github.com/repos/15thnight/15thnight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/15thnight/15thnight/labels{/name}","releases_url":"https://api.github.com/repos/15thnight/15thnight/releases{/id}","deployments_url":"https://api.github.com/repos/15thnight/15thnight/deployments","created_at":"2016-02-13T05:33:52Z","updated_at":"2016-07-14T00:55:09Z","pushed_at":"2016-08-02T23:52:01Z","git_url":"git://github.com/15thnight/15thnight.git","ssh_url":"git@github.com:15thnight/15thnight.git","clone_url":"https://github.com/15thnight/15thnight.git","svn_url":"https://github.com/15thnight/15thnight","homepage":null,"size":411,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/15thnight/15thnight/pulls/87"},"html":{"href":"https://github.com/15thnight/15thnight/pull/87"},"issue":{"href":"https://api.github.com/repos/15thnight/15thnight/issues/87"},"comments":{"href":"https://api.github.com/repos/15thnight/15thnight/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/15thnight/15thnight/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/15thnight/15thnight/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/15thnight/15thnight/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/15thnight/15thnight/statuses/6c15995bebf3e08cd8dc74e8752b455f3ee815ab"}}}}
{"actor":{"display_login":"spectralsun"}}