{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/olympia/pulls/comments/38441550","id":38441550,"diff_hunk":"@@ -0,0 +1,41 @@\n+# -*- coding: utf-8 -*-\n+from django.core.management.base import BaseCommand, CommandError\n+\n+import amo\n+from addons.models import Addon\n+from editors.helpers import ReviewHelper\n+\n+\n+class Command(BaseCommand):\n+    args = '<addon_guid addon_guid ...>'\n+    help = 'Approve a list of addons, given their GUIDs.'\n+\n+    def handle(self, *args, **options):\n+        if len(args) == 0:  # No GUID provided?\n+            raise CommandError(\n+                'Please provide at least one addon guid to approve.')\n+\n+        addons = Addon.with_unlisted.filter(\n+            guid__in=args,\n+            status__in=[amo.STATUS_NOMINATED, amo.STATUS_UNREVIEWED,\n+                        amo.STATUS_PENDING])\n+\n+        for addon in addons:\n+            print addon\n+\n+        confirm = raw_input(\n+            'Are you sure you want to bulk approve and sign all those {0} '\n+            'add-ons? (yes/no)'.format(len(addons)))\n+        if confirm != 'yes':\n+            raise CommandError(\"Aborted.\")\n+\n+        for addon in addons:\n+            helper = ReviewHelper(request=None, addon=addon,\n+                                  version=addon.latest_version)\n+            # Provide the file to review/sign to the helper.\n+            helper.set_data({'addon_files': [addon.latest_version.files],\n+                             'comments': 'bulk approval'})\n+            if addon.status in [amo.STATUS_NOMINATED, amo.STATUS_PENDING]:\n+                helper.handler.process_public()\n+            else:","path":"apps/addons/management/commands/approve_addons.py","position":40,"original_position":40,"commit_id":"e60ffd0adb4daaedfa5e2a292a5db88ed9bc5fc6","original_commit_id":"e60ffd0adb4daaedfa5e2a292a5db88ed9bc5fc6","user":{"login":"wagnerand","id":873258,"avatar_url":"https://avatars.githubusercontent.com/u/873258?v=3","gravatar_id":"","url":"https://api.github.com/users/wagnerand","html_url":"https://github.com/wagnerand","followers_url":"https://api.github.com/users/wagnerand/followers","following_url":"https://api.github.com/users/wagnerand/following{/other_user}","gists_url":"https://api.github.com/users/wagnerand/gists{/gist_id}","starred_url":"https://api.github.com/users/wagnerand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagnerand/subscriptions","organizations_url":"https://api.github.com/users/wagnerand/orgs","repos_url":"https://api.github.com/users/wagnerand/repos","events_url":"https://api.github.com/users/wagnerand/events{/privacy}","received_events_url":"https://api.github.com/users/wagnerand/received_events","type":"User","site_admin":false},"body":"Right, I knew I forgot something...","created_at":"2015-09-01T16:45:32Z","updated_at":"2015-09-01T16:45:32Z","html_url":"https://github.com/mozilla/olympia/pull/697#discussion_r38441550","pull_request_url":"https://api.github.com/repos/mozilla/olympia/pulls/697","_links":{"self":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/comments/38441550"},"html":{"href":"https://github.com/mozilla/olympia/pull/697#discussion_r38441550"},"pull_request":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/697"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/olympia/pulls/697","id":43522446,"html_url":"https://github.com/mozilla/olympia/pull/697","diff_url":"https://github.com/mozilla/olympia/pull/697.diff","patch_url":"https://github.com/mozilla/olympia/pull/697.patch","issue_url":"https://api.github.com/repos/mozilla/olympia/issues/697","number":697,"state":"open","locked":false,"title":"Add the approve_addons management command (bug 1199234)","user":{"login":"magopian","id":167767,"avatar_url":"https://avatars.githubusercontent.com/u/167767?v=3","gravatar_id":"","url":"https://api.github.com/users/magopian","html_url":"https://github.com/magopian","followers_url":"https://api.github.com/users/magopian/followers","following_url":"https://api.github.com/users/magopian/following{/other_user}","gists_url":"https://api.github.com/users/magopian/gists{/gist_id}","starred_url":"https://api.github.com/users/magopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magopian/subscriptions","organizations_url":"https://api.github.com/users/magopian/orgs","repos_url":"https://api.github.com/users/magopian/repos","events_url":"https://api.github.com/users/magopian/events{/privacy}","received_events_url":"https://api.github.com/users/magopian/received_events","type":"User","site_admin":false},"body":"Fixes [bug 1199234](https://bugzilla.mozilla.org/show_bug.cgi?id=1199234)","created_at":"2015-08-27T14:18:54Z","updated_at":"2015-09-01T16:45:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fec2be7cf290ca63cc9ec513d7c65b2c3fb18ca7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/olympia/pulls/697/commits","review_comments_url":"https://api.github.com/repos/mozilla/olympia/pulls/697/comments","review_comment_url":"https://api.github.com/repos/mozilla/olympia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/olympia/issues/697/comments","statuses_url":"https://api.github.com/repos/mozilla/olympia/statuses/e60ffd0adb4daaedfa5e2a292a5db88ed9bc5fc6","head":{"label":"magopian:1199234-bulk-approval-script","ref":"1199234-bulk-approval-script","sha":"e60ffd0adb4daaedfa5e2a292a5db88ed9bc5fc6","user":{"login":"magopian","id":167767,"avatar_url":"https://avatars.githubusercontent.com/u/167767?v=3","gravatar_id":"","url":"https://api.github.com/users/magopian","html_url":"https://github.com/magopian","followers_url":"https://api.github.com/users/magopian/followers","following_url":"https://api.github.com/users/magopian/following{/other_user}","gists_url":"https://api.github.com/users/magopian/gists{/gist_id}","starred_url":"https://api.github.com/users/magopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magopian/subscriptions","organizations_url":"https://api.github.com/users/magopian/orgs","repos_url":"https://api.github.com/users/magopian/repos","events_url":"https://api.github.com/users/magopian/events{/privacy}","received_events_url":"https://api.github.com/users/magopian/received_events","type":"User","site_admin":false},"repo":{"id":17664164,"name":"olympia","full_name":"magopian/olympia","owner":{"login":"magopian","id":167767,"avatar_url":"https://avatars.githubusercontent.com/u/167767?v=3","gravatar_id":"","url":"https://api.github.com/users/magopian","html_url":"https://github.com/magopian","followers_url":"https://api.github.com/users/magopian/followers","following_url":"https://api.github.com/users/magopian/following{/other_user}","gists_url":"https://api.github.com/users/magopian/gists{/gist_id}","starred_url":"https://api.github.com/users/magopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magopian/subscriptions","organizations_url":"https://api.github.com/users/magopian/orgs","repos_url":"https://api.github.com/users/magopian/repos","events_url":"https://api.github.com/users/magopian/events{/privacy}","received_events_url":"https://api.github.com/users/magopian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/magopian/olympia","description":"AMO, reloaded.","fork":true,"url":"https://api.github.com/repos/magopian/olympia","forks_url":"https://api.github.com/repos/magopian/olympia/forks","keys_url":"https://api.github.com/repos/magopian/olympia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magopian/olympia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magopian/olympia/teams","hooks_url":"https://api.github.com/repos/magopian/olympia/hooks","issue_events_url":"https://api.github.com/repos/magopian/olympia/issues/events{/number}","events_url":"https://api.github.com/repos/magopian/olympia/events","assignees_url":"https://api.github.com/repos/magopian/olympia/assignees{/user}","branches_url":"https://api.github.com/repos/magopian/olympia/branches{/branch}","tags_url":"https://api.github.com/repos/magopian/olympia/tags","blobs_url":"https://api.github.com/repos/magopian/olympia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magopian/olympia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magopian/olympia/git/refs{/sha}","trees_url":"https://api.github.com/repos/magopian/olympia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magopian/olympia/statuses/{sha}","languages_url":"https://api.github.com/repos/magopian/olympia/languages","stargazers_url":"https://api.github.com/repos/magopian/olympia/stargazers","contributors_url":"https://api.github.com/repos/magopian/olympia/contributors","subscribers_url":"https://api.github.com/repos/magopian/olympia/subscribers","subscription_url":"https://api.github.com/repos/magopian/olympia/subscription","commits_url":"https://api.github.com/repos/magopian/olympia/commits{/sha}","git_commits_url":"https://api.github.com/repos/magopian/olympia/git/commits{/sha}","comments_url":"https://api.github.com/repos/magopian/olympia/comments{/number}","issue_comment_url":"https://api.github.com/repos/magopian/olympia/issues/comments{/number}","contents_url":"https://api.github.com/repos/magopian/olympia/contents/{+path}","compare_url":"https://api.github.com/repos/magopian/olympia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magopian/olympia/merges","archive_url":"https://api.github.com/repos/magopian/olympia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magopian/olympia/downloads","issues_url":"https://api.github.com/repos/magopian/olympia/issues{/number}","pulls_url":"https://api.github.com/repos/magopian/olympia/pulls{/number}","milestones_url":"https://api.github.com/repos/magopian/olympia/milestones{/number}","notifications_url":"https://api.github.com/repos/magopian/olympia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magopian/olympia/labels{/name}","releases_url":"https://api.github.com/repos/magopian/olympia/releases{/id}","created_at":"2014-03-12T11:05:51Z","updated_at":"2015-04-24T16:05:25Z","pushed_at":"2015-08-28T15:37:12Z","git_url":"git://github.com/magopian/olympia.git","ssh_url":"git@github.com:magopian/olympia.git","clone_url":"https://github.com/magopian/olympia.git","svn_url":"https://github.com/magopian/olympia","homepage":"","size":415471,"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":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"94ce4181db1e19ae49dd30010d30de7f05150a5a","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":16416867,"name":"olympia","full_name":"mozilla/olympia","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/olympia","description":"addons.mozilla.org, reloaded.","fork":false,"url":"https://api.github.com/repos/mozilla/olympia","forks_url":"https://api.github.com/repos/mozilla/olympia/forks","keys_url":"https://api.github.com/repos/mozilla/olympia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/olympia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/olympia/teams","hooks_url":"https://api.github.com/repos/mozilla/olympia/hooks","issue_events_url":"https://api.github.com/repos/mozilla/olympia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/olympia/events","assignees_url":"https://api.github.com/repos/mozilla/olympia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/olympia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/olympia/tags","blobs_url":"https://api.github.com/repos/mozilla/olympia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/olympia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/olympia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/olympia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/olympia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/olympia/languages","stargazers_url":"https://api.github.com/repos/mozilla/olympia/stargazers","contributors_url":"https://api.github.com/repos/mozilla/olympia/contributors","subscribers_url":"https://api.github.com/repos/mozilla/olympia/subscribers","subscription_url":"https://api.github.com/repos/mozilla/olympia/subscription","commits_url":"https://api.github.com/repos/mozilla/olympia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/olympia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/olympia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/olympia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/olympia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/olympia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/olympia/merges","archive_url":"https://api.github.com/repos/mozilla/olympia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/olympia/downloads","issues_url":"https://api.github.com/repos/mozilla/olympia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/olympia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/olympia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/olympia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/olympia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/olympia/releases{/id}","created_at":"2014-01-31T18:44:15Z","updated_at":"2015-08-29T13:42:17Z","pushed_at":"2015-09-01T16:28:13Z","git_url":"git://github.com/mozilla/olympia.git","ssh_url":"git@github.com:mozilla/olympia.git","clone_url":"https://github.com/mozilla/olympia.git","svn_url":"https://github.com/mozilla/olympia","homepage":"https://addons.mozilla.org/","size":465204,"stargazers_count":49,"watchers_count":49,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":98,"mirror_url":null,"open_issues_count":16,"forks":98,"open_issues":16,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/697"},"html":{"href":"https://github.com/mozilla/olympia/pull/697"},"issue":{"href":"https://api.github.com/repos/mozilla/olympia/issues/697"},"comments":{"href":"https://api.github.com/repos/mozilla/olympia/issues/697/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/697/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/olympia/pulls/697/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/olympia/statuses/e60ffd0adb4daaedfa5e2a292a5db88ed9bc5fc6"}}}}