{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/zamboni/pulls/comments/37858023","id":37858023,"diff_hunk":"@@ -389,3 +392,58 @@ class PermissionsView(CORSMixin, MineMixin, RetrieveAPIView):\n     permission_classes = (AllowSelf,)\n     model = UserProfile\n     serializer_class = PermissionsSerializer\n+\n+\n+class GroupsViewSet(CORSMixin, ListModelMixin, DestroyModelMixin,\n+                    GenericViewSet):\n+    authentication_classes = [RestOAuthAuthentication,\n+                              RestSharedSecretAuthentication]\n+    cors_allowed_methods = ['get']\n+    serializer_class = GroupsSerializer\n+    permission_classes = [GroupPermission('Admin', '%')]\n+\n+    def paginate_queryset(self, queryset, page_size=None):\n+        return None\n+\n+    def get_queryset(self):\n+        return self.get_user().groups.all()\n+\n+    def get_user(self):\n+        try:\n+            return UserProfile.objects.get(pk=self.kwargs.get('pk'))\n+        except UserProfile.DoesNotExist:\n+            raise ParseError('User must exist.')","path":"mkt/account/views.py","position":63,"original_position":63,"commit_id":"6b02c4934e313e6c3c971605865e57f6ec95e639","original_commit_id":"6b02c4934e313e6c3c971605865e57f6ec95e639","user":{"login":"diox","id":187006,"avatar_url":"https://avatars.githubusercontent.com/u/187006?v=3","gravatar_id":"","url":"https://api.github.com/users/diox","html_url":"https://github.com/diox","followers_url":"https://api.github.com/users/diox/followers","following_url":"https://api.github.com/users/diox/following{/other_user}","gists_url":"https://api.github.com/users/diox/gists{/gist_id}","starred_url":"https://api.github.com/users/diox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diox/subscriptions","organizations_url":"https://api.github.com/users/diox/orgs","repos_url":"https://api.github.com/users/diox/repos","events_url":"https://api.github.com/users/diox/events{/privacy}","received_events_url":"https://api.github.com/users/diox/received_events","type":"User","site_admin":false},"body":"Not sure I've seen a test for that case.","created_at":"2015-08-25T12:19:09Z","updated_at":"2015-08-25T12:19:09Z","html_url":"https://github.com/mozilla/zamboni/pull/3209#discussion_r37858023","pull_request_url":"https://api.github.com/repos/mozilla/zamboni/pulls/3209","_links":{"self":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/comments/37858023"},"html":{"href":"https://github.com/mozilla/zamboni/pull/3209#discussion_r37858023"},"pull_request":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/3209"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/zamboni/pulls/3209","id":41489017,"html_url":"https://github.com/mozilla/zamboni/pull/3209","diff_url":"https://github.com/mozilla/zamboni/pull/3209.diff","patch_url":"https://github.com/mozilla/zamboni/pull/3209.patch","issue_url":"https://api.github.com/repos/mozilla/zamboni/issues/3209","number":3209,"state":"open","locked":false,"title":"Add group selector to lookup tool and API endpoint to set groups bug 867958","user":{"login":"eviljeff","id":768592,"avatar_url":"https://avatars.githubusercontent.com/u/768592?v=3","gravatar_id":"","url":"https://api.github.com/users/eviljeff","html_url":"https://github.com/eviljeff","followers_url":"https://api.github.com/users/eviljeff/followers","following_url":"https://api.github.com/users/eviljeff/following{/other_user}","gists_url":"https://api.github.com/users/eviljeff/gists{/gist_id}","starred_url":"https://api.github.com/users/eviljeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eviljeff/subscriptions","organizations_url":"https://api.github.com/users/eviljeff/orgs","repos_url":"https://api.github.com/users/eviljeff/repos","events_url":"https://api.github.com/users/eviljeff/events{/privacy}","received_events_url":"https://api.github.com/users/eviljeff/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-03T17:15:38Z","updated_at":"2015-08-25T12:19:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7db04c1d3a0be948a08468f305e9276e537dcad1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/zamboni/pulls/3209/commits","review_comments_url":"https://api.github.com/repos/mozilla/zamboni/pulls/3209/comments","review_comment_url":"https://api.github.com/repos/mozilla/zamboni/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/zamboni/issues/3209/comments","statuses_url":"https://api.github.com/repos/mozilla/zamboni/statuses/6b02c4934e313e6c3c971605865e57f6ec95e639","head":{"label":"eviljeff:manage-groups-in-lookup","ref":"manage-groups-in-lookup","sha":"6b02c4934e313e6c3c971605865e57f6ec95e639","user":{"login":"eviljeff","id":768592,"avatar_url":"https://avatars.githubusercontent.com/u/768592?v=3","gravatar_id":"","url":"https://api.github.com/users/eviljeff","html_url":"https://github.com/eviljeff","followers_url":"https://api.github.com/users/eviljeff/followers","following_url":"https://api.github.com/users/eviljeff/following{/other_user}","gists_url":"https://api.github.com/users/eviljeff/gists{/gist_id}","starred_url":"https://api.github.com/users/eviljeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eviljeff/subscriptions","organizations_url":"https://api.github.com/users/eviljeff/orgs","repos_url":"https://api.github.com/users/eviljeff/repos","events_url":"https://api.github.com/users/eviljeff/events{/privacy}","received_events_url":"https://api.github.com/users/eviljeff/received_events","type":"User","site_admin":false},"repo":{"id":2621451,"name":"zamboni","full_name":"eviljeff/zamboni","owner":{"login":"eviljeff","id":768592,"avatar_url":"https://avatars.githubusercontent.com/u/768592?v=3","gravatar_id":"","url":"https://api.github.com/users/eviljeff","html_url":"https://github.com/eviljeff","followers_url":"https://api.github.com/users/eviljeff/followers","following_url":"https://api.github.com/users/eviljeff/following{/other_user}","gists_url":"https://api.github.com/users/eviljeff/gists{/gist_id}","starred_url":"https://api.github.com/users/eviljeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eviljeff/subscriptions","organizations_url":"https://api.github.com/users/eviljeff/orgs","repos_url":"https://api.github.com/users/eviljeff/repos","events_url":"https://api.github.com/users/eviljeff/events{/privacy}","received_events_url":"https://api.github.com/users/eviljeff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eviljeff/zamboni","description":"A clandestine operation to make AMO happy","fork":true,"url":"https://api.github.com/repos/eviljeff/zamboni","forks_url":"https://api.github.com/repos/eviljeff/zamboni/forks","keys_url":"https://api.github.com/repos/eviljeff/zamboni/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eviljeff/zamboni/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eviljeff/zamboni/teams","hooks_url":"https://api.github.com/repos/eviljeff/zamboni/hooks","issue_events_url":"https://api.github.com/repos/eviljeff/zamboni/issues/events{/number}","events_url":"https://api.github.com/repos/eviljeff/zamboni/events","assignees_url":"https://api.github.com/repos/eviljeff/zamboni/assignees{/user}","branches_url":"https://api.github.com/repos/eviljeff/zamboni/branches{/branch}","tags_url":"https://api.github.com/repos/eviljeff/zamboni/tags","blobs_url":"https://api.github.com/repos/eviljeff/zamboni/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eviljeff/zamboni/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eviljeff/zamboni/git/refs{/sha}","trees_url":"https://api.github.com/repos/eviljeff/zamboni/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eviljeff/zamboni/statuses/{sha}","languages_url":"https://api.github.com/repos/eviljeff/zamboni/languages","stargazers_url":"https://api.github.com/repos/eviljeff/zamboni/stargazers","contributors_url":"https://api.github.com/repos/eviljeff/zamboni/contributors","subscribers_url":"https://api.github.com/repos/eviljeff/zamboni/subscribers","subscription_url":"https://api.github.com/repos/eviljeff/zamboni/subscription","commits_url":"https://api.github.com/repos/eviljeff/zamboni/commits{/sha}","git_commits_url":"https://api.github.com/repos/eviljeff/zamboni/git/commits{/sha}","comments_url":"https://api.github.com/repos/eviljeff/zamboni/comments{/number}","issue_comment_url":"https://api.github.com/repos/eviljeff/zamboni/issues/comments{/number}","contents_url":"https://api.github.com/repos/eviljeff/zamboni/contents/{+path}","compare_url":"https://api.github.com/repos/eviljeff/zamboni/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eviljeff/zamboni/merges","archive_url":"https://api.github.com/repos/eviljeff/zamboni/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eviljeff/zamboni/downloads","issues_url":"https://api.github.com/repos/eviljeff/zamboni/issues{/number}","pulls_url":"https://api.github.com/repos/eviljeff/zamboni/pulls{/number}","milestones_url":"https://api.github.com/repos/eviljeff/zamboni/milestones{/number}","notifications_url":"https://api.github.com/repos/eviljeff/zamboni/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eviljeff/zamboni/labels{/name}","releases_url":"https://api.github.com/repos/eviljeff/zamboni/releases{/id}","created_at":"2011-10-21T16:18:20Z","updated_at":"2014-07-24T18:07:38Z","pushed_at":"2015-08-24T17:13:08Z","git_url":"git://github.com/eviljeff/zamboni.git","ssh_url":"git@github.com:eviljeff/zamboni.git","clone_url":"https://github.com/eviljeff/zamboni.git","svn_url":"https://github.com/eviljeff/zamboni","homepage":"http://mozilla.github.com/zamboni/","size":384928,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"dbf77e44106e2347e5f63fb798af3aec5a1c7902","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":347655,"name":"zamboni","full_name":"mozilla/zamboni","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/zamboni","description":"Backend for the Firefox Marketplace","fork":false,"url":"https://api.github.com/repos/mozilla/zamboni","forks_url":"https://api.github.com/repos/mozilla/zamboni/forks","keys_url":"https://api.github.com/repos/mozilla/zamboni/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/zamboni/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/zamboni/teams","hooks_url":"https://api.github.com/repos/mozilla/zamboni/hooks","issue_events_url":"https://api.github.com/repos/mozilla/zamboni/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/zamboni/events","assignees_url":"https://api.github.com/repos/mozilla/zamboni/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/zamboni/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/zamboni/tags","blobs_url":"https://api.github.com/repos/mozilla/zamboni/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/zamboni/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/zamboni/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/zamboni/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/zamboni/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/zamboni/languages","stargazers_url":"https://api.github.com/repos/mozilla/zamboni/stargazers","contributors_url":"https://api.github.com/repos/mozilla/zamboni/contributors","subscribers_url":"https://api.github.com/repos/mozilla/zamboni/subscribers","subscription_url":"https://api.github.com/repos/mozilla/zamboni/subscription","commits_url":"https://api.github.com/repos/mozilla/zamboni/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/zamboni/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/zamboni/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/zamboni/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/zamboni/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/zamboni/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/zamboni/merges","archive_url":"https://api.github.com/repos/mozilla/zamboni/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/zamboni/downloads","issues_url":"https://api.github.com/repos/mozilla/zamboni/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/zamboni/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/zamboni/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/zamboni/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/zamboni/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/zamboni/releases{/id}","created_at":"2009-10-23T19:35:34Z","updated_at":"2015-08-19T13:36:06Z","pushed_at":"2015-08-25T10:48:54Z","git_url":"git://github.com/mozilla/zamboni.git","ssh_url":"git@github.com:mozilla/zamboni.git","clone_url":"https://github.com/mozilla/zamboni.git","svn_url":"https://github.com/mozilla/zamboni","homepage":"http://marketplace.readthedocs.org/en/latest/topics/backend.html","size":451455,"stargazers_count":467,"watchers_count":467,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":253,"mirror_url":null,"open_issues_count":17,"forks":253,"open_issues":17,"watchers":467,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/3209"},"html":{"href":"https://github.com/mozilla/zamboni/pull/3209"},"issue":{"href":"https://api.github.com/repos/mozilla/zamboni/issues/3209"},"comments":{"href":"https://api.github.com/repos/mozilla/zamboni/issues/3209/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/3209/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/3209/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/zamboni/statuses/6b02c4934e313e6c3c971605865e57f6ec95e639"}}}}