{"action":"created","comment":{"url":"https://api.github.com/repos/rapidpro/tracpro/pulls/comments/97573148","pull_request_review_id":18185093,"id":97573148,"diff_hunk":"@@ -130,3 +131,39 @@ def org_task(self, org):\n         are no longer on the remote.\n         \"\"\"\n         apps.get_model('polls', 'Poll').objects.sync(org)\n+\n+\n+@task\n+def sync_questions_categories(org, polls):\n+    # Create new or update SELECTED Polls to match RapidPro data.\n+    from tracpro.polls.models import Poll, Question\n+\n+    # Save the associated Questions for this poll here\n+    # now that these polls have been activated for the Org\n+    selected_poll_names, selected_polls = [], []\n+    for poll in polls:\n+        selected_poll_names.append(poll.name)\n+        selected_polls.append(Poll.objects.get(id=poll.id))","path":"tracpro/polls/tasks.py","position":32,"original_position":32,"commit_id":"a04180829fe12a1e436c623d38ae4a3f881056f6","original_commit_id":"a04180829fe12a1e436c623d38ae4a3f881056f6","user":{"login":"dpoirier","id":2788679,"avatar_url":"https://avatars.githubusercontent.com/u/2788679?v=3","gravatar_id":"","url":"https://api.github.com/users/dpoirier","html_url":"https://github.com/dpoirier","followers_url":"https://api.github.com/users/dpoirier/followers","following_url":"https://api.github.com/users/dpoirier/following{/other_user}","gists_url":"https://api.github.com/users/dpoirier/gists{/gist_id}","starred_url":"https://api.github.com/users/dpoirier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpoirier/subscriptions","organizations_url":"https://api.github.com/users/dpoirier/orgs","repos_url":"https://api.github.com/users/dpoirier/repos","events_url":"https://api.github.com/users/dpoirier/events{/privacy}","received_events_url":"https://api.github.com/users/dpoirier/received_events","type":"User","site_admin":false},"body":"Since we're passing in the polls that we're interested in, these 4 lines aren't really necessary anymore.","created_at":"2017-01-24T15:32:19Z","updated_at":"2017-01-24T15:36:20Z","html_url":"https://github.com/rapidpro/tracpro/pull/191#discussion_r97573148","pull_request_url":"https://api.github.com/repos/rapidpro/tracpro/pulls/191","_links":{"self":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/comments/97573148"},"html":{"href":"https://github.com/rapidpro/tracpro/pull/191#discussion_r97573148"},"pull_request":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/191"}}},"pull_request":{"url":"https://api.github.com/repos/rapidpro/tracpro/pulls/191","id":101868171,"html_url":"https://github.com/rapidpro/tracpro/pull/191","diff_url":"https://github.com/rapidpro/tracpro/pull/191.diff","patch_url":"https://github.com/rapidpro/tracpro/pull/191.patch","issue_url":"https://api.github.com/repos/rapidpro/tracpro/issues/191","number":191,"state":"open","locked":false,"title":"Fix timeout on poll selection","user":{"login":"emullaney","id":11393311,"avatar_url":"https://avatars.githubusercontent.com/u/11393311?v=3","gravatar_id":"","url":"https://api.github.com/users/emullaney","html_url":"https://github.com/emullaney","followers_url":"https://api.github.com/users/emullaney/followers","following_url":"https://api.github.com/users/emullaney/following{/other_user}","gists_url":"https://api.github.com/users/emullaney/gists{/gist_id}","starred_url":"https://api.github.com/users/emullaney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emullaney/subscriptions","organizations_url":"https://api.github.com/users/emullaney/orgs","repos_url":"https://api.github.com/users/emullaney/repos","events_url":"https://api.github.com/users/emullaney/events{/privacy}","received_events_url":"https://api.github.com/users/emullaney/received_events","type":"User","site_admin":false},"body":"Addresses https://caktus.atlassian.net/browse/TD-8\r\n\r\nThis is a proof of concept fix that I'd like to test out on staging.\r\n\r\nBecause the Poll sync also pulls down all question/categorical data down locally, it can time out when there are many polls for an org with a lot of questions. \r\n\r\nThis change moves the question sync into the form save so that only active polls get questions synced.","created_at":"2017-01-17T13:56:57Z","updated_at":"2017-01-24T15:36:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8884f67143c6c2ad1f1d5f34b5c44384fc7077a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rapidpro/tracpro/pulls/191/commits","review_comments_url":"https://api.github.com/repos/rapidpro/tracpro/pulls/191/comments","review_comment_url":"https://api.github.com/repos/rapidpro/tracpro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rapidpro/tracpro/issues/191/comments","statuses_url":"https://api.github.com/repos/rapidpro/tracpro/statuses/a04180829fe12a1e436c623d38ae4a3f881056f6","head":{"label":"rapidpro:fix-timeout-on-poll-selection","ref":"fix-timeout-on-poll-selection","sha":"a04180829fe12a1e436c623d38ae4a3f881056f6","user":{"login":"rapidpro","id":7733752,"avatar_url":"https://avatars.githubusercontent.com/u/7733752?v=3","gravatar_id":"","url":"https://api.github.com/users/rapidpro","html_url":"https://github.com/rapidpro","followers_url":"https://api.github.com/users/rapidpro/followers","following_url":"https://api.github.com/users/rapidpro/following{/other_user}","gists_url":"https://api.github.com/users/rapidpro/gists{/gist_id}","starred_url":"https://api.github.com/users/rapidpro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapidpro/subscriptions","organizations_url":"https://api.github.com/users/rapidpro/orgs","repos_url":"https://api.github.com/users/rapidpro/repos","events_url":"https://api.github.com/users/rapidpro/events{/privacy}","received_events_url":"https://api.github.com/users/rapidpro/received_events","type":"Organization","site_admin":false},"repo":{"id":29589268,"name":"tracpro","full_name":"rapidpro/tracpro","owner":{"login":"rapidpro","id":7733752,"avatar_url":"https://avatars.githubusercontent.com/u/7733752?v=3","gravatar_id":"","url":"https://api.github.com/users/rapidpro","html_url":"https://github.com/rapidpro","followers_url":"https://api.github.com/users/rapidpro/followers","following_url":"https://api.github.com/users/rapidpro/following{/other_user}","gists_url":"https://api.github.com/users/rapidpro/gists{/gist_id}","starred_url":"https://api.github.com/users/rapidpro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapidpro/subscriptions","organizations_url":"https://api.github.com/users/rapidpro/orgs","repos_url":"https://api.github.com/users/rapidpro/repos","events_url":"https://api.github.com/users/rapidpro/events{/privacy}","received_events_url":"https://api.github.com/users/rapidpro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapidpro/tracpro","description":"Polls dashboard for RapidPro","fork":false,"url":"https://api.github.com/repos/rapidpro/tracpro","forks_url":"https://api.github.com/repos/rapidpro/tracpro/forks","keys_url":"https://api.github.com/repos/rapidpro/tracpro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapidpro/tracpro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapidpro/tracpro/teams","hooks_url":"https://api.github.com/repos/rapidpro/tracpro/hooks","issue_events_url":"https://api.github.com/repos/rapidpro/tracpro/issues/events{/number}","events_url":"https://api.github.com/repos/rapidpro/tracpro/events","assignees_url":"https://api.github.com/repos/rapidpro/tracpro/assignees{/user}","branches_url":"https://api.github.com/repos/rapidpro/tracpro/branches{/branch}","tags_url":"https://api.github.com/repos/rapidpro/tracpro/tags","blobs_url":"https://api.github.com/repos/rapidpro/tracpro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapidpro/tracpro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapidpro/tracpro/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapidpro/tracpro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapidpro/tracpro/statuses/{sha}","languages_url":"https://api.github.com/repos/rapidpro/tracpro/languages","stargazers_url":"https://api.github.com/repos/rapidpro/tracpro/stargazers","contributors_url":"https://api.github.com/repos/rapidpro/tracpro/contributors","subscribers_url":"https://api.github.com/repos/rapidpro/tracpro/subscribers","subscription_url":"https://api.github.com/repos/rapidpro/tracpro/subscription","commits_url":"https://api.github.com/repos/rapidpro/tracpro/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapidpro/tracpro/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapidpro/tracpro/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapidpro/tracpro/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapidpro/tracpro/contents/{+path}","compare_url":"https://api.github.com/repos/rapidpro/tracpro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapidpro/tracpro/merges","archive_url":"https://api.github.com/repos/rapidpro/tracpro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapidpro/tracpro/downloads","issues_url":"https://api.github.com/repos/rapidpro/tracpro/issues{/number}","pulls_url":"https://api.github.com/repos/rapidpro/tracpro/pulls{/number}","milestones_url":"https://api.github.com/repos/rapidpro/tracpro/milestones{/number}","notifications_url":"https://api.github.com/repos/rapidpro/tracpro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapidpro/tracpro/labels{/name}","releases_url":"https://api.github.com/repos/rapidpro/tracpro/releases{/id}","deployments_url":"https://api.github.com/repos/rapidpro/tracpro/deployments","created_at":"2015-01-21T12:51:24Z","updated_at":"2017-01-23T13:01:45Z","pushed_at":"2017-01-24T14:55:47Z","git_url":"git://github.com/rapidpro/tracpro.git","ssh_url":"git@github.com:rapidpro/tracpro.git","clone_url":"https://github.com/rapidpro/tracpro.git","svn_url":"https://github.com/rapidpro/tracpro","homepage":null,"size":3400,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":10,"forks":8,"open_issues":10,"watchers":1,"default_branch":"develop"}},"base":{"label":"rapidpro:develop","ref":"develop","sha":"637eb9423ca782c536c39d67cf72489d5fda06a0","user":{"login":"rapidpro","id":7733752,"avatar_url":"https://avatars.githubusercontent.com/u/7733752?v=3","gravatar_id":"","url":"https://api.github.com/users/rapidpro","html_url":"https://github.com/rapidpro","followers_url":"https://api.github.com/users/rapidpro/followers","following_url":"https://api.github.com/users/rapidpro/following{/other_user}","gists_url":"https://api.github.com/users/rapidpro/gists{/gist_id}","starred_url":"https://api.github.com/users/rapidpro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapidpro/subscriptions","organizations_url":"https://api.github.com/users/rapidpro/orgs","repos_url":"https://api.github.com/users/rapidpro/repos","events_url":"https://api.github.com/users/rapidpro/events{/privacy}","received_events_url":"https://api.github.com/users/rapidpro/received_events","type":"Organization","site_admin":false},"repo":{"id":29589268,"name":"tracpro","full_name":"rapidpro/tracpro","owner":{"login":"rapidpro","id":7733752,"avatar_url":"https://avatars.githubusercontent.com/u/7733752?v=3","gravatar_id":"","url":"https://api.github.com/users/rapidpro","html_url":"https://github.com/rapidpro","followers_url":"https://api.github.com/users/rapidpro/followers","following_url":"https://api.github.com/users/rapidpro/following{/other_user}","gists_url":"https://api.github.com/users/rapidpro/gists{/gist_id}","starred_url":"https://api.github.com/users/rapidpro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapidpro/subscriptions","organizations_url":"https://api.github.com/users/rapidpro/orgs","repos_url":"https://api.github.com/users/rapidpro/repos","events_url":"https://api.github.com/users/rapidpro/events{/privacy}","received_events_url":"https://api.github.com/users/rapidpro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapidpro/tracpro","description":"Polls dashboard for RapidPro","fork":false,"url":"https://api.github.com/repos/rapidpro/tracpro","forks_url":"https://api.github.com/repos/rapidpro/tracpro/forks","keys_url":"https://api.github.com/repos/rapidpro/tracpro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapidpro/tracpro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapidpro/tracpro/teams","hooks_url":"https://api.github.com/repos/rapidpro/tracpro/hooks","issue_events_url":"https://api.github.com/repos/rapidpro/tracpro/issues/events{/number}","events_url":"https://api.github.com/repos/rapidpro/tracpro/events","assignees_url":"https://api.github.com/repos/rapidpro/tracpro/assignees{/user}","branches_url":"https://api.github.com/repos/rapidpro/tracpro/branches{/branch}","tags_url":"https://api.github.com/repos/rapidpro/tracpro/tags","blobs_url":"https://api.github.com/repos/rapidpro/tracpro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapidpro/tracpro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapidpro/tracpro/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapidpro/tracpro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapidpro/tracpro/statuses/{sha}","languages_url":"https://api.github.com/repos/rapidpro/tracpro/languages","stargazers_url":"https://api.github.com/repos/rapidpro/tracpro/stargazers","contributors_url":"https://api.github.com/repos/rapidpro/tracpro/contributors","subscribers_url":"https://api.github.com/repos/rapidpro/tracpro/subscribers","subscription_url":"https://api.github.com/repos/rapidpro/tracpro/subscription","commits_url":"https://api.github.com/repos/rapidpro/tracpro/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapidpro/tracpro/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapidpro/tracpro/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapidpro/tracpro/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapidpro/tracpro/contents/{+path}","compare_url":"https://api.github.com/repos/rapidpro/tracpro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapidpro/tracpro/merges","archive_url":"https://api.github.com/repos/rapidpro/tracpro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapidpro/tracpro/downloads","issues_url":"https://api.github.com/repos/rapidpro/tracpro/issues{/number}","pulls_url":"https://api.github.com/repos/rapidpro/tracpro/pulls{/number}","milestones_url":"https://api.github.com/repos/rapidpro/tracpro/milestones{/number}","notifications_url":"https://api.github.com/repos/rapidpro/tracpro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapidpro/tracpro/labels{/name}","releases_url":"https://api.github.com/repos/rapidpro/tracpro/releases{/id}","deployments_url":"https://api.github.com/repos/rapidpro/tracpro/deployments","created_at":"2015-01-21T12:51:24Z","updated_at":"2017-01-23T13:01:45Z","pushed_at":"2017-01-24T14:55:47Z","git_url":"git://github.com/rapidpro/tracpro.git","ssh_url":"git@github.com:rapidpro/tracpro.git","clone_url":"https://github.com/rapidpro/tracpro.git","svn_url":"https://github.com/rapidpro/tracpro","homepage":null,"size":3400,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":10,"forks":8,"open_issues":10,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/191"},"html":{"href":"https://github.com/rapidpro/tracpro/pull/191"},"issue":{"href":"https://api.github.com/repos/rapidpro/tracpro/issues/191"},"comments":{"href":"https://api.github.com/repos/rapidpro/tracpro/issues/191/comments"},"review_comments":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/191/comments"},"review_comment":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/191/commits"},"statuses":{"href":"https://api.github.com/repos/rapidpro/tracpro/statuses/a04180829fe12a1e436c623d38ae4a3f881056f6"}}}}
{"actor":{"display_login":"dpoirier"}}