{"action":"created","comment":{"url":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/comments/30251336","id":30251336,"diff_hunk":"@@ -0,0 +1,27 @@\n+from flask import redirect, url_for\n+from flask.ext.admin import Admin\n+from flask.ext.admin.contrib.sqla import ModelView\n+from flask.ext.security import current_user\n+from sourcemash.database import db\n+from sourcemash.models import Feed\n+\n+admin = Admin()\n+\n+\n+class FeedView(ModelView):\n+    can_create = False\n+    can_delete = False\n+\n+    def is_accessible(self):\n+        return current_user.is_authenticated() and \\\n+               current_user.email == \"admin@sourcemash.com\"\n+\n+    def _handle_view(self, name, **kwargs):\n+            if not self.is_accessible():\n+                return redirect(url_for('security.login'))\n+\n+    column_display_pk = True\n+    form_columns = ['title', 'topic', 'public', 'image_url']\n+\n+\n+admin.add_view(FeedView(Feed, db.session))","path":"sourcemash/admin.py","position":27,"original_position":27,"commit_id":"c3f12b952a4dc81e366ddc2172203aa800ee1e55","original_commit_id":"c3f12b952a4dc81e366ddc2172203aa800ee1e55","user":{"login":"alexgerstein","id":1390314,"avatar_url":"https://avatars.githubusercontent.com/u/1390314?v=3","gravatar_id":"","url":"https://api.github.com/users/alexgerstein","html_url":"https://github.com/alexgerstein","followers_url":"https://api.github.com/users/alexgerstein/followers","following_url":"https://api.github.com/users/alexgerstein/following{/other_user}","gists_url":"https://api.github.com/users/alexgerstein/gists{/gist_id}","starred_url":"https://api.github.com/users/alexgerstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexgerstein/subscriptions","organizations_url":"https://api.github.com/users/alexgerstein/orgs","repos_url":"https://api.github.com/users/alexgerstein/repos","events_url":"https://api.github.com/users/alexgerstein/events{/privacy}","received_events_url":"https://api.github.com/users/alexgerstein/received_events","type":"User","site_admin":false},"body":"Yessir\n\nAlex Gerstein\ngerstein.alex@gmail.com\n\n\n\n\nOn Wed, May 13, 2015 at 9:56 AM -0700, \"Scott Gladstone\" <notifications@github.com> wrote:\n\n\n\n\n\n\n\n\n\n\n\n\nIn sourcemash/admin.py:\n> +    can_create = False\n> +    can_delete = False\n> +\n> +    def is_accessible(self):\n> +        return current_user.is_authenticated() and \\\n> +               current_user.email == \"admin@sourcemash.com\"\n> +\n> +    def _handle_view(self, name, **kwargs):\n> +            if not self.is_accessible():\n> +                return redirect(url_for('security.login'))\n> +\n> +    column_display_pk = True\n> +    form_columns = ['title', 'topic', 'public', 'image_url']\n> +\n> +\n> +admin.add_view(FeedView(Feed, db.session))\n\n\n\nIs the admin page at /admin? \n\n\n\n—\nReply to this email directly or view it on GitHub.","created_at":"2015-05-13T16:56:34Z","updated_at":"2015-05-13T16:56:34Z","html_url":"https://github.com/sourcemash/Sourcemash/pull/289#discussion_r30251336","pull_request_url":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/289","_links":{"self":{"href":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/comments/30251336"},"html":{"href":"https://github.com/sourcemash/Sourcemash/pull/289#discussion_r30251336"},"pull_request":{"href":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/289"}}},"pull_request":{"url":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/289","id":35290381,"html_url":"https://github.com/sourcemash/Sourcemash/pull/289","diff_url":"https://github.com/sourcemash/Sourcemash/pull/289.diff","patch_url":"https://github.com/sourcemash/Sourcemash/pull/289.patch","issue_url":"https://api.github.com/repos/sourcemash/Sourcemash/issues/289","number":289,"state":"open","locked":false,"title":"Admin Page","user":{"login":"alexgerstein","id":1390314,"avatar_url":"https://avatars.githubusercontent.com/u/1390314?v=3","gravatar_id":"","url":"https://api.github.com/users/alexgerstein","html_url":"https://github.com/alexgerstein","followers_url":"https://api.github.com/users/alexgerstein/followers","following_url":"https://api.github.com/users/alexgerstein/following{/other_user}","gists_url":"https://api.github.com/users/alexgerstein/gists{/gist_id}","starred_url":"https://api.github.com/users/alexgerstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexgerstein/subscriptions","organizations_url":"https://api.github.com/users/alexgerstein/orgs","repos_url":"https://api.github.com/users/alexgerstein/repos","events_url":"https://api.github.com/users/alexgerstein/events{/privacy}","received_events_url":"https://api.github.com/users/alexgerstein/received_events","type":"User","site_admin":false},"body":"Closes #120.","created_at":"2015-05-13T02:57:51Z","updated_at":"2015-05-13T16:56:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"615e10a6f5fd7fefdf9b9df59b5a670950912e77","assignee":{"login":"swglad","id":5695548,"avatar_url":"https://avatars.githubusercontent.com/u/5695548?v=3","gravatar_id":"","url":"https://api.github.com/users/swglad","html_url":"https://github.com/swglad","followers_url":"https://api.github.com/users/swglad/followers","following_url":"https://api.github.com/users/swglad/following{/other_user}","gists_url":"https://api.github.com/users/swglad/gists{/gist_id}","starred_url":"https://api.github.com/users/swglad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swglad/subscriptions","organizations_url":"https://api.github.com/users/swglad/orgs","repos_url":"https://api.github.com/users/swglad/repos","events_url":"https://api.github.com/users/swglad/events{/privacy}","received_events_url":"https://api.github.com/users/swglad/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/sourcemash/Sourcemash/milestones/17","html_url":"https://github.com/sourcemash/Sourcemash/milestones/Week%2017","labels_url":"https://api.github.com/repos/sourcemash/Sourcemash/milestones/17/labels","id":1096301,"number":17,"title":"Week 17","description":"","creator":{"login":"swglad","id":5695548,"avatar_url":"https://avatars.githubusercontent.com/u/5695548?v=3","gravatar_id":"","url":"https://api.github.com/users/swglad","html_url":"https://github.com/swglad","followers_url":"https://api.github.com/users/swglad/followers","following_url":"https://api.github.com/users/swglad/following{/other_user}","gists_url":"https://api.github.com/users/swglad/gists{/gist_id}","starred_url":"https://api.github.com/users/swglad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swglad/subscriptions","organizations_url":"https://api.github.com/users/swglad/orgs","repos_url":"https://api.github.com/users/swglad/repos","events_url":"https://api.github.com/users/swglad/events{/privacy}","received_events_url":"https://api.github.com/users/swglad/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":3,"state":"open","created_at":"2015-05-05T07:02:21Z","updated_at":"2015-05-13T16:49:33Z","due_on":"2015-05-18T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/289/commits","review_comments_url":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/289/comments","review_comment_url":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sourcemash/Sourcemash/issues/289/comments","statuses_url":"https://api.github.com/repos/sourcemash/Sourcemash/statuses/c3f12b952a4dc81e366ddc2172203aa800ee1e55","head":{"label":"sourcemash:admin","ref":"admin","sha":"c3f12b952a4dc81e366ddc2172203aa800ee1e55","user":{"login":"sourcemash","id":11763607,"avatar_url":"https://avatars.githubusercontent.com/u/11763607?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcemash","html_url":"https://github.com/sourcemash","followers_url":"https://api.github.com/users/sourcemash/followers","following_url":"https://api.github.com/users/sourcemash/following{/other_user}","gists_url":"https://api.github.com/users/sourcemash/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcemash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcemash/subscriptions","organizations_url":"https://api.github.com/users/sourcemash/orgs","repos_url":"https://api.github.com/users/sourcemash/repos","events_url":"https://api.github.com/users/sourcemash/events{/privacy}","received_events_url":"https://api.github.com/users/sourcemash/received_events","type":"Organization","site_admin":false},"repo":{"id":29208817,"name":"Sourcemash","full_name":"sourcemash/Sourcemash","owner":{"login":"sourcemash","id":11763607,"avatar_url":"https://avatars.githubusercontent.com/u/11763607?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcemash","html_url":"https://github.com/sourcemash","followers_url":"https://api.github.com/users/sourcemash/followers","following_url":"https://api.github.com/users/sourcemash/following{/other_user}","gists_url":"https://api.github.com/users/sourcemash/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcemash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcemash/subscriptions","organizations_url":"https://api.github.com/users/sourcemash/orgs","repos_url":"https://api.github.com/users/sourcemash/repos","events_url":"https://api.github.com/users/sourcemash/events{/privacy}","received_events_url":"https://api.github.com/users/sourcemash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sourcemash/Sourcemash","description":"Read Your News Faster.","fork":false,"url":"https://api.github.com/repos/sourcemash/Sourcemash","forks_url":"https://api.github.com/repos/sourcemash/Sourcemash/forks","keys_url":"https://api.github.com/repos/sourcemash/Sourcemash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourcemash/Sourcemash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourcemash/Sourcemash/teams","hooks_url":"https://api.github.com/repos/sourcemash/Sourcemash/hooks","issue_events_url":"https://api.github.com/repos/sourcemash/Sourcemash/issues/events{/number}","events_url":"https://api.github.com/repos/sourcemash/Sourcemash/events","assignees_url":"https://api.github.com/repos/sourcemash/Sourcemash/assignees{/user}","branches_url":"https://api.github.com/repos/sourcemash/Sourcemash/branches{/branch}","tags_url":"https://api.github.com/repos/sourcemash/Sourcemash/tags","blobs_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourcemash/Sourcemash/statuses/{sha}","languages_url":"https://api.github.com/repos/sourcemash/Sourcemash/languages","stargazers_url":"https://api.github.com/repos/sourcemash/Sourcemash/stargazers","contributors_url":"https://api.github.com/repos/sourcemash/Sourcemash/contributors","subscribers_url":"https://api.github.com/repos/sourcemash/Sourcemash/subscribers","subscription_url":"https://api.github.com/repos/sourcemash/Sourcemash/subscription","commits_url":"https://api.github.com/repos/sourcemash/Sourcemash/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourcemash/Sourcemash/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourcemash/Sourcemash/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourcemash/Sourcemash/contents/{+path}","compare_url":"https://api.github.com/repos/sourcemash/Sourcemash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourcemash/Sourcemash/merges","archive_url":"https://api.github.com/repos/sourcemash/Sourcemash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourcemash/Sourcemash/downloads","issues_url":"https://api.github.com/repos/sourcemash/Sourcemash/issues{/number}","pulls_url":"https://api.github.com/repos/sourcemash/Sourcemash/pulls{/number}","milestones_url":"https://api.github.com/repos/sourcemash/Sourcemash/milestones{/number}","notifications_url":"https://api.github.com/repos/sourcemash/Sourcemash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourcemash/Sourcemash/labels{/name}","releases_url":"https://api.github.com/repos/sourcemash/Sourcemash/releases{/id}","created_at":"2015-01-13T20:12:47Z","updated_at":"2015-05-08T16:50:04Z","pushed_at":"2015-05-13T16:49:33Z","git_url":"git://github.com/sourcemash/Sourcemash.git","ssh_url":"git@github.com:sourcemash/Sourcemash.git","clone_url":"https://github.com/sourcemash/Sourcemash.git","svn_url":"https://github.com/sourcemash/Sourcemash","homepage":"http://sourcemash.com","size":4816,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":55,"forks":0,"open_issues":55,"watchers":2,"default_branch":"master"}},"base":{"label":"sourcemash:master","ref":"master","sha":"6de8113dd0f737db8d8c86fa77a41b6066dba137","user":{"login":"sourcemash","id":11763607,"avatar_url":"https://avatars.githubusercontent.com/u/11763607?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcemash","html_url":"https://github.com/sourcemash","followers_url":"https://api.github.com/users/sourcemash/followers","following_url":"https://api.github.com/users/sourcemash/following{/other_user}","gists_url":"https://api.github.com/users/sourcemash/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcemash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcemash/subscriptions","organizations_url":"https://api.github.com/users/sourcemash/orgs","repos_url":"https://api.github.com/users/sourcemash/repos","events_url":"https://api.github.com/users/sourcemash/events{/privacy}","received_events_url":"https://api.github.com/users/sourcemash/received_events","type":"Organization","site_admin":false},"repo":{"id":29208817,"name":"Sourcemash","full_name":"sourcemash/Sourcemash","owner":{"login":"sourcemash","id":11763607,"avatar_url":"https://avatars.githubusercontent.com/u/11763607?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcemash","html_url":"https://github.com/sourcemash","followers_url":"https://api.github.com/users/sourcemash/followers","following_url":"https://api.github.com/users/sourcemash/following{/other_user}","gists_url":"https://api.github.com/users/sourcemash/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcemash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcemash/subscriptions","organizations_url":"https://api.github.com/users/sourcemash/orgs","repos_url":"https://api.github.com/users/sourcemash/repos","events_url":"https://api.github.com/users/sourcemash/events{/privacy}","received_events_url":"https://api.github.com/users/sourcemash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sourcemash/Sourcemash","description":"Read Your News Faster.","fork":false,"url":"https://api.github.com/repos/sourcemash/Sourcemash","forks_url":"https://api.github.com/repos/sourcemash/Sourcemash/forks","keys_url":"https://api.github.com/repos/sourcemash/Sourcemash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourcemash/Sourcemash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourcemash/Sourcemash/teams","hooks_url":"https://api.github.com/repos/sourcemash/Sourcemash/hooks","issue_events_url":"https://api.github.com/repos/sourcemash/Sourcemash/issues/events{/number}","events_url":"https://api.github.com/repos/sourcemash/Sourcemash/events","assignees_url":"https://api.github.com/repos/sourcemash/Sourcemash/assignees{/user}","branches_url":"https://api.github.com/repos/sourcemash/Sourcemash/branches{/branch}","tags_url":"https://api.github.com/repos/sourcemash/Sourcemash/tags","blobs_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourcemash/Sourcemash/statuses/{sha}","languages_url":"https://api.github.com/repos/sourcemash/Sourcemash/languages","stargazers_url":"https://api.github.com/repos/sourcemash/Sourcemash/stargazers","contributors_url":"https://api.github.com/repos/sourcemash/Sourcemash/contributors","subscribers_url":"https://api.github.com/repos/sourcemash/Sourcemash/subscribers","subscription_url":"https://api.github.com/repos/sourcemash/Sourcemash/subscription","commits_url":"https://api.github.com/repos/sourcemash/Sourcemash/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourcemash/Sourcemash/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourcemash/Sourcemash/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourcemash/Sourcemash/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourcemash/Sourcemash/contents/{+path}","compare_url":"https://api.github.com/repos/sourcemash/Sourcemash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourcemash/Sourcemash/merges","archive_url":"https://api.github.com/repos/sourcemash/Sourcemash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourcemash/Sourcemash/downloads","issues_url":"https://api.github.com/repos/sourcemash/Sourcemash/issues{/number}","pulls_url":"https://api.github.com/repos/sourcemash/Sourcemash/pulls{/number}","milestones_url":"https://api.github.com/repos/sourcemash/Sourcemash/milestones{/number}","notifications_url":"https://api.github.com/repos/sourcemash/Sourcemash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourcemash/Sourcemash/labels{/name}","releases_url":"https://api.github.com/repos/sourcemash/Sourcemash/releases{/id}","created_at":"2015-01-13T20:12:47Z","updated_at":"2015-05-08T16:50:04Z","pushed_at":"2015-05-13T16:49:33Z","git_url":"git://github.com/sourcemash/Sourcemash.git","ssh_url":"git@github.com:sourcemash/Sourcemash.git","clone_url":"https://github.com/sourcemash/Sourcemash.git","svn_url":"https://github.com/sourcemash/Sourcemash","homepage":"http://sourcemash.com","size":4816,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":55,"forks":0,"open_issues":55,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/289"},"html":{"href":"https://github.com/sourcemash/Sourcemash/pull/289"},"issue":{"href":"https://api.github.com/repos/sourcemash/Sourcemash/issues/289"},"comments":{"href":"https://api.github.com/repos/sourcemash/Sourcemash/issues/289/comments"},"review_comments":{"href":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/289/comments"},"review_comment":{"href":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sourcemash/Sourcemash/pulls/289/commits"},"statuses":{"href":"https://api.github.com/repos/sourcemash/Sourcemash/statuses/c3f12b952a4dc81e366ddc2172203aa800ee1e55"}}}}