{"action":"created","comment":{"url":"https://api.github.com/repos/zulip/zulip/pulls/comments/197926677","pull_request_review_id":131765475,"id":197926677,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzkyNjY3Nw==","diff_hunk":"@@ -334,6 +334,19 @@ def add_subscriptions_backend(\n     (subscribed, already_subscribed) = bulk_add_subscriptions(streams, subscribers,\n                                                               acting_user=user_profile)\n \n+    # Make acting user a stream admin, if acting user subscribed to newly created streams.\n+    if user_profile.email in principals:\n+        for stream in created_streams:\n+            recipient = get_stream_recipient(stream.id)\n+            try:\n+                sub = Subscription.objects.get(user_profile=user_profile,\n+                                               recipient=recipient)\n+            except Subscription.DoesNotExist:  # nocoverage\n+                # If user is present in principals, then user should be subscribed to stream. But\n+                # in case if not then just pass.\n+                pass\n+            do_change_subscription_property(user_profile, sub, stream, \"is_stream_admin\", True)","path":"zerver/views/streams.py","position":89,"original_position":89,"commit_id":"c28fcddf7ad2d91f8616a995b46f7d58b4028618","original_commit_id":"c28fcddf7ad2d91f8616a995b46f7d58b4028618","user":{"login":"hackerkid","id":7190633,"node_id":"MDQ6VXNlcjcxOTA2MzM=","avatar_url":"https://avatars1.githubusercontent.com/u/7190633?v=4","gravatar_id":"","url":"https://api.github.com/users/hackerkid","html_url":"https://github.com/hackerkid","followers_url":"https://api.github.com/users/hackerkid/followers","following_url":"https://api.github.com/users/hackerkid/following{/other_user}","gists_url":"https://api.github.com/users/hackerkid/gists{/gist_id}","starred_url":"https://api.github.com/users/hackerkid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackerkid/subscriptions","organizations_url":"https://api.github.com/users/hackerkid/orgs","repos_url":"https://api.github.com/users/hackerkid/repos","events_url":"https://api.github.com/users/hackerkid/events{/privacy}","received_events_url":"https://api.github.com/users/hackerkid/received_events","type":"User","site_admin":false},"body":"If the exception occurs `sub` would not be defined right?","created_at":"2018-06-25T20:13:06Z","updated_at":"2018-06-25T20:13:40Z","html_url":"https://github.com/zulip/zulip/pull/9765#discussion_r197926677","pull_request_url":"https://api.github.com/repos/zulip/zulip/pulls/9765","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments/197926677"},"html":{"href":"https://github.com/zulip/zulip/pull/9765#discussion_r197926677"},"pull_request":{"href":"https://api.github.com/repos/zulip/zulip/pulls/9765"}}},"pull_request":{"url":"https://api.github.com/repos/zulip/zulip/pulls/9765","id":195429031,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1NDI5MDMx","html_url":"https://github.com/zulip/zulip/pull/9765","diff_url":"https://github.com/zulip/zulip/pull/9765.diff","patch_url":"https://github.com/zulip/zulip/pull/9765.patch","issue_url":"https://api.github.com/repos/zulip/zulip/issues/9765","number":9765,"state":"open","locked":false,"title":"[WIP] Different stream admin authentications","user":{"login":"YJDave","id":25907420,"node_id":"MDQ6VXNlcjI1OTA3NDIw","avatar_url":"https://avatars2.githubusercontent.com/u/25907420?v=4","gravatar_id":"","url":"https://api.github.com/users/YJDave","html_url":"https://github.com/YJDave","followers_url":"https://api.github.com/users/YJDave/followers","following_url":"https://api.github.com/users/YJDave/following{/other_user}","gists_url":"https://api.github.com/users/YJDave/gists{/gist_id}","starred_url":"https://api.github.com/users/YJDave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YJDave/subscriptions","organizations_url":"https://api.github.com/users/YJDave/orgs","repos_url":"https://api.github.com/users/YJDave/repos","events_url":"https://api.github.com/users/YJDave/events{/privacy}","received_events_url":"https://api.github.com/users/YJDave/received_events","type":"User","site_admin":false},"body":"Its still in progress, @hackerkid and @timabbott please give review when you got time, if its going in right direction or not. ","created_at":"2018-06-18T06:05:18Z","updated_at":"2018-06-25T20:13:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9934d192ef2047c138c7219458fb72cf7dfa9836","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":804160549,"node_id":"MDU6TGFiZWw4MDQxNjA1NDk=","url":"https://api.github.com/repos/zulip/zulip/labels/size:%20XL","name":"size: XL","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/zulip/zulip/pulls/9765/commits","review_comments_url":"https://api.github.com/repos/zulip/zulip/pulls/9765/comments","review_comment_url":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/9765/comments","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/c28fcddf7ad2d91f8616a995b46f7d58b4028618","head":{"label":"YJDave:stream_admin","ref":"stream_admin","sha":"c28fcddf7ad2d91f8616a995b46f7d58b4028618","user":{"login":"YJDave","id":25907420,"node_id":"MDQ6VXNlcjI1OTA3NDIw","avatar_url":"https://avatars2.githubusercontent.com/u/25907420?v=4","gravatar_id":"","url":"https://api.github.com/users/YJDave","html_url":"https://github.com/YJDave","followers_url":"https://api.github.com/users/YJDave/followers","following_url":"https://api.github.com/users/YJDave/following{/other_user}","gists_url":"https://api.github.com/users/YJDave/gists{/gist_id}","starred_url":"https://api.github.com/users/YJDave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YJDave/subscriptions","organizations_url":"https://api.github.com/users/YJDave/orgs","repos_url":"https://api.github.com/users/YJDave/repos","events_url":"https://api.github.com/users/YJDave/events{/privacy}","received_events_url":"https://api.github.com/users/YJDave/received_events","type":"User","site_admin":false},"repo":{"id":102934999,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI5MzQ5OTk=","name":"zulip","full_name":"YJDave/zulip","owner":{"login":"YJDave","id":25907420,"node_id":"MDQ6VXNlcjI1OTA3NDIw","avatar_url":"https://avatars2.githubusercontent.com/u/25907420?v=4","gravatar_id":"","url":"https://api.github.com/users/YJDave","html_url":"https://github.com/YJDave","followers_url":"https://api.github.com/users/YJDave/followers","following_url":"https://api.github.com/users/YJDave/following{/other_user}","gists_url":"https://api.github.com/users/YJDave/gists{/gist_id}","starred_url":"https://api.github.com/users/YJDave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YJDave/subscriptions","organizations_url":"https://api.github.com/users/YJDave/orgs","repos_url":"https://api.github.com/users/YJDave/repos","events_url":"https://api.github.com/users/YJDave/events{/privacy}","received_events_url":"https://api.github.com/users/YJDave/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/YJDave/zulip","description":"Zulip server - powerful open source group chat","fork":true,"url":"https://api.github.com/repos/YJDave/zulip","forks_url":"https://api.github.com/repos/YJDave/zulip/forks","keys_url":"https://api.github.com/repos/YJDave/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YJDave/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YJDave/zulip/teams","hooks_url":"https://api.github.com/repos/YJDave/zulip/hooks","issue_events_url":"https://api.github.com/repos/YJDave/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/YJDave/zulip/events","assignees_url":"https://api.github.com/repos/YJDave/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/YJDave/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/YJDave/zulip/tags","blobs_url":"https://api.github.com/repos/YJDave/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YJDave/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YJDave/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/YJDave/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YJDave/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/YJDave/zulip/languages","stargazers_url":"https://api.github.com/repos/YJDave/zulip/stargazers","contributors_url":"https://api.github.com/repos/YJDave/zulip/contributors","subscribers_url":"https://api.github.com/repos/YJDave/zulip/subscribers","subscription_url":"https://api.github.com/repos/YJDave/zulip/subscription","commits_url":"https://api.github.com/repos/YJDave/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/YJDave/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/YJDave/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/YJDave/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/YJDave/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/YJDave/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YJDave/zulip/merges","archive_url":"https://api.github.com/repos/YJDave/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YJDave/zulip/downloads","issues_url":"https://api.github.com/repos/YJDave/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/YJDave/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/YJDave/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/YJDave/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YJDave/zulip/labels{/name}","releases_url":"https://api.github.com/repos/YJDave/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/YJDave/zulip/deployments","created_at":"2017-09-09T07:16:10Z","updated_at":"2018-06-19T04:12:51Z","pushed_at":"2018-06-25T11:08:39Z","git_url":"git://github.com/YJDave/zulip.git","ssh_url":"git@github.com:YJDave/zulip.git","clone_url":"https://github.com/YJDave/zulip.git","svn_url":"https://github.com/YJDave/zulip","homepage":"","size":210425,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zulip:master","ref":"master","sha":"25c46e3abbdc76cddd42bbc8bcceb528cdaa9354","user":{"login":"zulip","id":4921959,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MjE5NTk=","avatar_url":"https://avatars2.githubusercontent.com/u/4921959?v=4","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"repo":{"id":43160685,"node_id":"MDEwOlJlcG9zaXRvcnk0MzE2MDY4NQ==","name":"zulip","full_name":"zulip/zulip","owner":{"login":"zulip","id":4921959,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MjE5NTk=","avatar_url":"https://avatars2.githubusercontent.com/u/4921959?v=4","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zulip/zulip","description":"Zulip server - powerful open source team chat","fork":false,"url":"https://api.github.com/repos/zulip/zulip","forks_url":"https://api.github.com/repos/zulip/zulip/forks","keys_url":"https://api.github.com/repos/zulip/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zulip/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zulip/zulip/teams","hooks_url":"https://api.github.com/repos/zulip/zulip/hooks","issue_events_url":"https://api.github.com/repos/zulip/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/zulip/zulip/events","assignees_url":"https://api.github.com/repos/zulip/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/zulip/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/zulip/zulip/tags","blobs_url":"https://api.github.com/repos/zulip/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zulip/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zulip/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/zulip/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/zulip/zulip/languages","stargazers_url":"https://api.github.com/repos/zulip/zulip/stargazers","contributors_url":"https://api.github.com/repos/zulip/zulip/contributors","subscribers_url":"https://api.github.com/repos/zulip/zulip/subscribers","subscription_url":"https://api.github.com/repos/zulip/zulip/subscription","commits_url":"https://api.github.com/repos/zulip/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/zulip/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/zulip/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/zulip/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/zulip/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/zulip/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zulip/zulip/merges","archive_url":"https://api.github.com/repos/zulip/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zulip/zulip/downloads","issues_url":"https://api.github.com/repos/zulip/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/zulip/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/zulip/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/zulip/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zulip/zulip/labels{/name}","releases_url":"https://api.github.com/repos/zulip/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/zulip/zulip/deployments","created_at":"2015-09-25T16:37:25Z","updated_at":"2018-06-25T01:09:35Z","pushed_at":"2018-06-25T20:01:08Z","git_url":"git://github.com/zulip/zulip.git","ssh_url":"git@github.com:zulip/zulip.git","clone_url":"https://github.com/zulip/zulip.git","svn_url":"https://github.com/zulip/zulip","homepage":"https://zulip.org/","size":210368,"stargazers_count":7363,"watchers_count":7363,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2253,"mirror_url":null,"archived":false,"open_issues_count":1009,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2253,"open_issues":1009,"watchers":7363,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/9765"},"html":{"href":"https://github.com/zulip/zulip/pull/9765"},"issue":{"href":"https://api.github.com/repos/zulip/zulip/issues/9765"},"comments":{"href":"https://api.github.com/repos/zulip/zulip/issues/9765/comments"},"review_comments":{"href":"https://api.github.com/repos/zulip/zulip/pulls/9765/comments"},"review_comment":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zulip/zulip/pulls/9765/commits"},"statuses":{"href":"https://api.github.com/repos/zulip/zulip/statuses/c28fcddf7ad2d91f8616a995b46f7d58b4028618"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"hackerkid"}}