{"action":"created","comment":{"url":"https://api.github.com/repos/flavour/eden/pulls/comments/47910457","id":47910457,"diff_hunk":"@@ -515,28 +605,288 @@ def _manage_subscriptions(self, resources, filters):\n \n             subscription[\"filters\"] = form.request_vars \\\n                                       .get(\"subscription-filters\", None)\n-\n             # Fixed method\n             subscription[\"method\"] = formvars.method\n             # Fixed Notify On and Frequency\n             subscription[\"notify_on\"] = [\"new\"]\n             subscription[\"frequency\"] = \"immediately\"\n             # Alternatively, with notify and frequency selector\n-            #subscription[\"notify_on\"] = listify(formvars.notify_on\n+            #subscription[\"notify_on\"] = listify(formvars.notify_on)\n             #subscription[\"frequency\"] = formvars.frequency\n-\n-            success_subscription = self._update_subscription(subscription)\n-\n-            if \"Sync\" in subscription[\"method\"] and formvars.repository_id:\n-                properties = self._update_sync(subscription[\"subscribe\"][0]['resource'],\n-                                               subscription.get(\"filters\"),\n-                                               int(formvars.repository_id),\n-                                               properties)\n-                properties = json.dumps(properties)\n-                db(stable.pe_id == current.auth.user.pe_id).update(comments=properties)\n+            # Group IDs\n+            group_ids = formvars[\"group-filter\"]\n+            # Recipient IDs\n+            user_ids = formvars[\"person-filter\"]\n+\n+            update_admin_subscription = self._update_admin_subscription\n+            bulk_user_pe_id = auth.s3_bulk_user_pe_id\n+            pr_group_table = s3db.pr_group\n+            define_resource = s3db.resource\n+            base_query = (stable.deleted != True)\n+            if user_ids is not None:\n+                # Admin Subscriptions\n+                if group_ids is not None and \\\n+                   len(group_ids) > 0 and \\\n+                   len(user_ids) > 0:\n+                    # Both selection","path":"modules/templates/SAMBRO/controllers.py","position":385,"original_position":385,"commit_id":"7b813deac313bd731114604e18a4d9f1a912144d","original_commit_id":"7b813deac313bd731114604e18a4d9f1a912144d","user":{"login":"flavour","id":389592,"avatar_url":"https://avatars.githubusercontent.com/u/389592?v=3","gravatar_id":"","url":"https://api.github.com/users/flavour","html_url":"https://github.com/flavour","followers_url":"https://api.github.com/users/flavour/followers","following_url":"https://api.github.com/users/flavour/following{/other_user}","gists_url":"https://api.github.com/users/flavour/gists{/gist_id}","starred_url":"https://api.github.com/users/flavour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flavour/subscriptions","organizations_url":"https://api.github.com/users/flavour/orgs","repos_url":"https://api.github.com/users/flavour/repos","events_url":"https://api.github.com/users/flavour/events{/privacy}","received_events_url":"https://api.github.com/users/flavour/received_events","type":"User","site_admin":false},"body":"Ah: \"Both Users & Groups selected\"","created_at":"2015-12-17T14:25:32Z","updated_at":"2015-12-17T14:25:32Z","html_url":"https://github.com/flavour/eden/pull/1205#discussion_r47910457","pull_request_url":"https://api.github.com/repos/flavour/eden/pulls/1205","_links":{"self":{"href":"https://api.github.com/repos/flavour/eden/pulls/comments/47910457"},"html":{"href":"https://github.com/flavour/eden/pull/1205#discussion_r47910457"},"pull_request":{"href":"https://api.github.com/repos/flavour/eden/pulls/1205"}}},"pull_request":{"url":"https://api.github.com/repos/flavour/eden/pulls/1205","id":51488407,"html_url":"https://github.com/flavour/eden/pull/1205","diff_url":"https://github.com/flavour/eden/pull/1205.diff","patch_url":"https://github.com/flavour/eden/pull/1205.patch","issue_url":"https://api.github.com/repos/flavour/eden/issues/1205","number":1205,"state":"open","locked":false,"title":"SAMBRO: admin subscriptions","user":{"login":"biplovbhandari","id":4207677,"avatar_url":"https://avatars.githubusercontent.com/u/4207677?v=3","gravatar_id":"","url":"https://api.github.com/users/biplovbhandari","html_url":"https://github.com/biplovbhandari","followers_url":"https://api.github.com/users/biplovbhandari/followers","following_url":"https://api.github.com/users/biplovbhandari/following{/other_user}","gists_url":"https://api.github.com/users/biplovbhandari/gists{/gist_id}","starred_url":"https://api.github.com/users/biplovbhandari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biplovbhandari/subscriptions","organizations_url":"https://api.github.com/users/biplovbhandari/orgs","repos_url":"https://api.github.com/users/biplovbhandari/repos","events_url":"https://api.github.com/users/biplovbhandari/events{/privacy}","received_events_url":"https://api.github.com/users/biplovbhandari/received_events","type":"User","site_admin":false},"body":"@flavour Please merge","created_at":"2015-11-23T05:06:37Z","updated_at":"2015-12-17T14:25:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99d58830f83061130224a84b3df119505ed0da2c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flavour/eden/pulls/1205/commits","review_comments_url":"https://api.github.com/repos/flavour/eden/pulls/1205/comments","review_comment_url":"https://api.github.com/repos/flavour/eden/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flavour/eden/issues/1205/comments","statuses_url":"https://api.github.com/repos/flavour/eden/statuses/7b813deac313bd731114604e18a4d9f1a912144d","head":{"label":"biplovbhandari:master","ref":"master","sha":"7b813deac313bd731114604e18a4d9f1a912144d","user":{"login":"biplovbhandari","id":4207677,"avatar_url":"https://avatars.githubusercontent.com/u/4207677?v=3","gravatar_id":"","url":"https://api.github.com/users/biplovbhandari","html_url":"https://github.com/biplovbhandari","followers_url":"https://api.github.com/users/biplovbhandari/followers","following_url":"https://api.github.com/users/biplovbhandari/following{/other_user}","gists_url":"https://api.github.com/users/biplovbhandari/gists{/gist_id}","starred_url":"https://api.github.com/users/biplovbhandari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biplovbhandari/subscriptions","organizations_url":"https://api.github.com/users/biplovbhandari/orgs","repos_url":"https://api.github.com/users/biplovbhandari/repos","events_url":"https://api.github.com/users/biplovbhandari/events{/privacy}","received_events_url":"https://api.github.com/users/biplovbhandari/received_events","type":"User","site_admin":false},"repo":{"id":37774689,"name":"eden","full_name":"biplovbhandari/eden","owner":{"login":"biplovbhandari","id":4207677,"avatar_url":"https://avatars.githubusercontent.com/u/4207677?v=3","gravatar_id":"","url":"https://api.github.com/users/biplovbhandari","html_url":"https://github.com/biplovbhandari","followers_url":"https://api.github.com/users/biplovbhandari/followers","following_url":"https://api.github.com/users/biplovbhandari/following{/other_user}","gists_url":"https://api.github.com/users/biplovbhandari/gists{/gist_id}","starred_url":"https://api.github.com/users/biplovbhandari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biplovbhandari/subscriptions","organizations_url":"https://api.github.com/users/biplovbhandari/orgs","repos_url":"https://api.github.com/users/biplovbhandari/repos","events_url":"https://api.github.com/users/biplovbhandari/events{/privacy}","received_events_url":"https://api.github.com/users/biplovbhandari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/biplovbhandari/eden","description":"Sahana Eden is an Open Source Humanitarian Platform which can be used to provide solutions for Disaster Management, Development, and Environmental Management sectors.. Please sign CLA when submitting pull requests: http://bit.ly/SSF-eCLA","fork":true,"url":"https://api.github.com/repos/biplovbhandari/eden","forks_url":"https://api.github.com/repos/biplovbhandari/eden/forks","keys_url":"https://api.github.com/repos/biplovbhandari/eden/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biplovbhandari/eden/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biplovbhandari/eden/teams","hooks_url":"https://api.github.com/repos/biplovbhandari/eden/hooks","issue_events_url":"https://api.github.com/repos/biplovbhandari/eden/issues/events{/number}","events_url":"https://api.github.com/repos/biplovbhandari/eden/events","assignees_url":"https://api.github.com/repos/biplovbhandari/eden/assignees{/user}","branches_url":"https://api.github.com/repos/biplovbhandari/eden/branches{/branch}","tags_url":"https://api.github.com/repos/biplovbhandari/eden/tags","blobs_url":"https://api.github.com/repos/biplovbhandari/eden/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biplovbhandari/eden/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biplovbhandari/eden/git/refs{/sha}","trees_url":"https://api.github.com/repos/biplovbhandari/eden/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biplovbhandari/eden/statuses/{sha}","languages_url":"https://api.github.com/repos/biplovbhandari/eden/languages","stargazers_url":"https://api.github.com/repos/biplovbhandari/eden/stargazers","contributors_url":"https://api.github.com/repos/biplovbhandari/eden/contributors","subscribers_url":"https://api.github.com/repos/biplovbhandari/eden/subscribers","subscription_url":"https://api.github.com/repos/biplovbhandari/eden/subscription","commits_url":"https://api.github.com/repos/biplovbhandari/eden/commits{/sha}","git_commits_url":"https://api.github.com/repos/biplovbhandari/eden/git/commits{/sha}","comments_url":"https://api.github.com/repos/biplovbhandari/eden/comments{/number}","issue_comment_url":"https://api.github.com/repos/biplovbhandari/eden/issues/comments{/number}","contents_url":"https://api.github.com/repos/biplovbhandari/eden/contents/{+path}","compare_url":"https://api.github.com/repos/biplovbhandari/eden/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biplovbhandari/eden/merges","archive_url":"https://api.github.com/repos/biplovbhandari/eden/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biplovbhandari/eden/downloads","issues_url":"https://api.github.com/repos/biplovbhandari/eden/issues{/number}","pulls_url":"https://api.github.com/repos/biplovbhandari/eden/pulls{/number}","milestones_url":"https://api.github.com/repos/biplovbhandari/eden/milestones{/number}","notifications_url":"https://api.github.com/repos/biplovbhandari/eden/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biplovbhandari/eden/labels{/name}","releases_url":"https://api.github.com/repos/biplovbhandari/eden/releases{/id}","created_at":"2015-06-20T15:32:51Z","updated_at":"2015-06-20T15:33:04Z","pushed_at":"2015-12-07T16:37:00Z","git_url":"git://github.com/biplovbhandari/eden.git","ssh_url":"git@github.com:biplovbhandari/eden.git","clone_url":"https://github.com/biplovbhandari/eden.git","svn_url":"https://github.com/biplovbhandari/eden","homepage":"http://eden.sahanafoundation.org","size":167459,"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":"flavour:master","ref":"master","sha":"0135e272b8ad7e4fab324926eeab5e7a367b73d4","user":{"login":"flavour","id":389592,"avatar_url":"https://avatars.githubusercontent.com/u/389592?v=3","gravatar_id":"","url":"https://api.github.com/users/flavour","html_url":"https://github.com/flavour","followers_url":"https://api.github.com/users/flavour/followers","following_url":"https://api.github.com/users/flavour/following{/other_user}","gists_url":"https://api.github.com/users/flavour/gists{/gist_id}","starred_url":"https://api.github.com/users/flavour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flavour/subscriptions","organizations_url":"https://api.github.com/users/flavour/orgs","repos_url":"https://api.github.com/users/flavour/repos","events_url":"https://api.github.com/users/flavour/events{/privacy}","received_events_url":"https://api.github.com/users/flavour/received_events","type":"User","site_admin":false},"repo":{"id":3021325,"name":"eden","full_name":"flavour/eden","owner":{"login":"flavour","id":389592,"avatar_url":"https://avatars.githubusercontent.com/u/389592?v=3","gravatar_id":"","url":"https://api.github.com/users/flavour","html_url":"https://github.com/flavour","followers_url":"https://api.github.com/users/flavour/followers","following_url":"https://api.github.com/users/flavour/following{/other_user}","gists_url":"https://api.github.com/users/flavour/gists{/gist_id}","starred_url":"https://api.github.com/users/flavour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flavour/subscriptions","organizations_url":"https://api.github.com/users/flavour/orgs","repos_url":"https://api.github.com/users/flavour/repos","events_url":"https://api.github.com/users/flavour/events{/privacy}","received_events_url":"https://api.github.com/users/flavour/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/flavour/eden","description":"Sahana Eden is an Open Source Humanitarian Platform which can be used to provide solutions for Disaster Management, Development, and Environmental Management sectors.. Please sign CLA when submitting pull requests: http://bit.ly/SSF-eCLA","fork":false,"url":"https://api.github.com/repos/flavour/eden","forks_url":"https://api.github.com/repos/flavour/eden/forks","keys_url":"https://api.github.com/repos/flavour/eden/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flavour/eden/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flavour/eden/teams","hooks_url":"https://api.github.com/repos/flavour/eden/hooks","issue_events_url":"https://api.github.com/repos/flavour/eden/issues/events{/number}","events_url":"https://api.github.com/repos/flavour/eden/events","assignees_url":"https://api.github.com/repos/flavour/eden/assignees{/user}","branches_url":"https://api.github.com/repos/flavour/eden/branches{/branch}","tags_url":"https://api.github.com/repos/flavour/eden/tags","blobs_url":"https://api.github.com/repos/flavour/eden/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flavour/eden/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flavour/eden/git/refs{/sha}","trees_url":"https://api.github.com/repos/flavour/eden/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flavour/eden/statuses/{sha}","languages_url":"https://api.github.com/repos/flavour/eden/languages","stargazers_url":"https://api.github.com/repos/flavour/eden/stargazers","contributors_url":"https://api.github.com/repos/flavour/eden/contributors","subscribers_url":"https://api.github.com/repos/flavour/eden/subscribers","subscription_url":"https://api.github.com/repos/flavour/eden/subscription","commits_url":"https://api.github.com/repos/flavour/eden/commits{/sha}","git_commits_url":"https://api.github.com/repos/flavour/eden/git/commits{/sha}","comments_url":"https://api.github.com/repos/flavour/eden/comments{/number}","issue_comment_url":"https://api.github.com/repos/flavour/eden/issues/comments{/number}","contents_url":"https://api.github.com/repos/flavour/eden/contents/{+path}","compare_url":"https://api.github.com/repos/flavour/eden/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flavour/eden/merges","archive_url":"https://api.github.com/repos/flavour/eden/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flavour/eden/downloads","issues_url":"https://api.github.com/repos/flavour/eden/issues{/number}","pulls_url":"https://api.github.com/repos/flavour/eden/pulls{/number}","milestones_url":"https://api.github.com/repos/flavour/eden/milestones{/number}","notifications_url":"https://api.github.com/repos/flavour/eden/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flavour/eden/labels{/name}","releases_url":"https://api.github.com/repos/flavour/eden/releases{/id}","created_at":"2011-12-20T17:49:16Z","updated_at":"2015-12-05T17:00:36Z","pushed_at":"2015-12-17T10:20:51Z","git_url":"git://github.com/flavour/eden.git","ssh_url":"git@github.com:flavour/eden.git","clone_url":"https://github.com/flavour/eden.git","svn_url":"https://github.com/flavour/eden","homepage":"http://eden.sahanafoundation.org","size":170095,"stargazers_count":176,"watchers_count":176,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":436,"mirror_url":null,"open_issues_count":60,"forks":436,"open_issues":60,"watchers":176,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flavour/eden/pulls/1205"},"html":{"href":"https://github.com/flavour/eden/pull/1205"},"issue":{"href":"https://api.github.com/repos/flavour/eden/issues/1205"},"comments":{"href":"https://api.github.com/repos/flavour/eden/issues/1205/comments"},"review_comments":{"href":"https://api.github.com/repos/flavour/eden/pulls/1205/comments"},"review_comment":{"href":"https://api.github.com/repos/flavour/eden/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flavour/eden/pulls/1205/commits"},"statuses":{"href":"https://api.github.com/repos/flavour/eden/statuses/7b813deac313bd731114604e18a4d9f1a912144d"}}}}