{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/kuma/pulls/comments/56231974","id":56231974,"diff_hunk":"@@ -0,0 +1,19 @@\n+\"\"\"\n+Delete old DocumentSpamAttempt data\n+\"\"\"\n+from optparse import make_option\n+\n+from django.core.management.base import BaseCommand\n+from kuma.wiki.tasks import delete_old_documentspamattempt_data\n+\n+\n+class Command(BaseCommand):\n+    help = \"Delete old DocumentSpamAttempt.data\"\n+    option_list = BaseCommand.option_list + (\n+        make_option('--days', dest=\"days\", default=30, type=int,\n+                    help=\"How many days 'old'\"),\n+    )\n+\n+    def handle(self, *args, **options):\n+        self.options = options","path":"kuma/wiki/management/commands/delete_old_spam_attempt_data.py","position":18,"original_position":18,"commit_id":"69ee88444d73decdaece0006dfc2a1f19fc4a510","original_commit_id":"69ee88444d73decdaece0006dfc2a1f19fc4a510","user":{"login":"jezdez","id":1610,"avatar_url":"https://avatars.githubusercontent.com/u/1610?v=3","gravatar_id":"","url":"https://api.github.com/users/jezdez","html_url":"https://github.com/jezdez","followers_url":"https://api.github.com/users/jezdez/followers","following_url":"https://api.github.com/users/jezdez/following{/other_user}","gists_url":"https://api.github.com/users/jezdez/gists{/gist_id}","starred_url":"https://api.github.com/users/jezdez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jezdez/subscriptions","organizations_url":"https://api.github.com/users/jezdez/orgs","repos_url":"https://api.github.com/users/jezdez/repos","events_url":"https://api.github.com/users/jezdez/events{/privacy}","received_events_url":"https://api.github.com/users/jezdez/received_events","type":"User","site_admin":false},"body":"No need to set `self.options` here","created_at":"2016-03-15T20:11:43Z","updated_at":"2016-03-15T20:11:43Z","html_url":"https://github.com/mozilla/kuma/pull/3816#discussion_r56231974","pull_request_url":"https://api.github.com/repos/mozilla/kuma/pulls/3816","_links":{"self":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/comments/56231974"},"html":{"href":"https://github.com/mozilla/kuma/pull/3816#discussion_r56231974"},"pull_request":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3816"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/kuma/pulls/3816","id":62968011,"html_url":"https://github.com/mozilla/kuma/pull/3816","diff_url":"https://github.com/mozilla/kuma/pull/3816.diff","patch_url":"https://github.com/mozilla/kuma/pull/3816.patch","issue_url":"https://api.github.com/repos/mozilla/kuma/issues/3816","number":3816,"state":"open","locked":false,"title":"bug 1255609 - Enable training on false positives","user":{"login":"jwhitlock","id":286017,"avatar_url":"https://avatars.githubusercontent.com/u/286017?v=3","gravatar_id":"","url":"https://api.github.com/users/jwhitlock","html_url":"https://github.com/jwhitlock","followers_url":"https://api.github.com/users/jwhitlock/followers","following_url":"https://api.github.com/users/jwhitlock/following{/other_user}","gists_url":"https://api.github.com/users/jwhitlock/gists{/gist_id}","starred_url":"https://api.github.com/users/jwhitlock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwhitlock/subscriptions","organizations_url":"https://api.github.com/users/jwhitlock/orgs","repos_url":"https://api.github.com/users/jwhitlock/repos","events_url":"https://api.github.com/users/jwhitlock/events{/privacy}","received_events_url":"https://api.github.com/users/jwhitlock/received_events","type":"User","site_admin":false},"body":"Add additional data to wiki's DocumentSpamAttempt:\r\n* data - JSON-serialized data sent to Akismet\r\n* review - Staff review status (default 'Needs Review')\r\n* reviewer - Staff reviewer\r\n* reviewed - Review date\r\n\r\nOld DocumentSpamAttempts do not have this additional data, so their status is set to \"Review Unavailable\".\r\n\r\nUpdate the Django admin for DocumentSpamAttempt so that it works better as a dashboard for second-guessing Akismet:\r\n* Limit the length of title and slug on the list display\r\n* Allow filtering by \"Needs Review\", to treat the admin as a review backlog.\r\n* Add an editable dropdown to quickly review multiple edits from known users\r\n* When a review of \"Spam\" is chosen, it confims Akismet's choice, and no futher API call is needed.\r\n* When a review of \"Ham / False Positive\" is chosen, submit the original data to Akismet's submit_ham API endpoint. On failure, revert to unreviewed status so it can be tried again.\r\n\r\nAdd a management command and task to drop submission data for old records, saving database resources and removing unneeded PII.\r\n\r\nUpdate the anonymization scripts to drop submission data.\r\n\r\nIt can be hard to test this locally. If you want to, it helps to create a user 'viagra-test-123', which will always be counted as spam:\r\n\r\n![spam dashboard](https://cloud.githubusercontent.com/assets/286017/13792236/e6d76e06-eabe-11e5-863a-6ee2106b2924.png)","created_at":"2016-03-15T20:03:30Z","updated_at":"2016-03-15T20:11:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2fba9af38cef79766170e789f294283d7aaca8c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/kuma/pulls/3816/commits","review_comments_url":"https://api.github.com/repos/mozilla/kuma/pulls/3816/comments","review_comment_url":"https://api.github.com/repos/mozilla/kuma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/kuma/issues/3816/comments","statuses_url":"https://api.github.com/repos/mozilla/kuma/statuses/69ee88444d73decdaece0006dfc2a1f19fc4a510","head":{"label":"mozilla:spam_dashboard_1255609","ref":"spam_dashboard_1255609","sha":"69ee88444d73decdaece0006dfc2a1f19fc4a510","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1352520,"name":"kuma","full_name":"mozilla/kuma","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/kuma","description":"The project that powers MDN.","fork":false,"url":"https://api.github.com/repos/mozilla/kuma","forks_url":"https://api.github.com/repos/mozilla/kuma/forks","keys_url":"https://api.github.com/repos/mozilla/kuma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/kuma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/kuma/teams","hooks_url":"https://api.github.com/repos/mozilla/kuma/hooks","issue_events_url":"https://api.github.com/repos/mozilla/kuma/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/kuma/events","assignees_url":"https://api.github.com/repos/mozilla/kuma/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/kuma/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/kuma/tags","blobs_url":"https://api.github.com/repos/mozilla/kuma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/kuma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/kuma/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/kuma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/kuma/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/kuma/languages","stargazers_url":"https://api.github.com/repos/mozilla/kuma/stargazers","contributors_url":"https://api.github.com/repos/mozilla/kuma/contributors","subscribers_url":"https://api.github.com/repos/mozilla/kuma/subscribers","subscription_url":"https://api.github.com/repos/mozilla/kuma/subscription","commits_url":"https://api.github.com/repos/mozilla/kuma/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/kuma/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/kuma/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/kuma/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/kuma/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/kuma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/kuma/merges","archive_url":"https://api.github.com/repos/mozilla/kuma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/kuma/downloads","issues_url":"https://api.github.com/repos/mozilla/kuma/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/kuma/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/kuma/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/kuma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/kuma/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/kuma/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/kuma/deployments","created_at":"2011-02-10T21:48:06Z","updated_at":"2016-03-15T15:12:55Z","pushed_at":"2016-03-15T20:08:23Z","git_url":"git://github.com/mozilla/kuma.git","ssh_url":"git@github.com:mozilla/kuma.git","clone_url":"https://github.com/mozilla/kuma.git","svn_url":"https://github.com/mozilla/kuma","homepage":"https://developer.mozilla.org","size":157864,"stargazers_count":770,"watchers_count":770,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":472,"mirror_url":null,"open_issues_count":12,"forks":472,"open_issues":12,"watchers":770,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"0be36a8e39929466d55f13c9de050b7c14b57b23","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1352520,"name":"kuma","full_name":"mozilla/kuma","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/kuma","description":"The project that powers MDN.","fork":false,"url":"https://api.github.com/repos/mozilla/kuma","forks_url":"https://api.github.com/repos/mozilla/kuma/forks","keys_url":"https://api.github.com/repos/mozilla/kuma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/kuma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/kuma/teams","hooks_url":"https://api.github.com/repos/mozilla/kuma/hooks","issue_events_url":"https://api.github.com/repos/mozilla/kuma/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/kuma/events","assignees_url":"https://api.github.com/repos/mozilla/kuma/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/kuma/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/kuma/tags","blobs_url":"https://api.github.com/repos/mozilla/kuma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/kuma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/kuma/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/kuma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/kuma/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/kuma/languages","stargazers_url":"https://api.github.com/repos/mozilla/kuma/stargazers","contributors_url":"https://api.github.com/repos/mozilla/kuma/contributors","subscribers_url":"https://api.github.com/repos/mozilla/kuma/subscribers","subscription_url":"https://api.github.com/repos/mozilla/kuma/subscription","commits_url":"https://api.github.com/repos/mozilla/kuma/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/kuma/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/kuma/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/kuma/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/kuma/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/kuma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/kuma/merges","archive_url":"https://api.github.com/repos/mozilla/kuma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/kuma/downloads","issues_url":"https://api.github.com/repos/mozilla/kuma/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/kuma/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/kuma/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/kuma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/kuma/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/kuma/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/kuma/deployments","created_at":"2011-02-10T21:48:06Z","updated_at":"2016-03-15T15:12:55Z","pushed_at":"2016-03-15T20:08:23Z","git_url":"git://github.com/mozilla/kuma.git","ssh_url":"git@github.com:mozilla/kuma.git","clone_url":"https://github.com/mozilla/kuma.git","svn_url":"https://github.com/mozilla/kuma","homepage":"https://developer.mozilla.org","size":157864,"stargazers_count":770,"watchers_count":770,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":472,"mirror_url":null,"open_issues_count":12,"forks":472,"open_issues":12,"watchers":770,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3816"},"html":{"href":"https://github.com/mozilla/kuma/pull/3816"},"issue":{"href":"https://api.github.com/repos/mozilla/kuma/issues/3816"},"comments":{"href":"https://api.github.com/repos/mozilla/kuma/issues/3816/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3816/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3816/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/kuma/statuses/69ee88444d73decdaece0006dfc2a1f19fc4a510"}}}}