{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/240727400","pull_request_review_id":183823936,"id":240727400,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDcyNzQwMA==","diff_hunk":"@@ -3,25 +3,16 @@\n from collections import namedtuple\n from datetime import datetime, timedelta\n import pytz\n-import six\n import attr\n \n-from casexml.apps.case.mock import CaseBlock\n-import uuid\n-from xml.etree import cElementTree as ElementTree\n-from corehq.apps.app_manager.const import USERCASE_TYPE\n-from corehq.apps.callcenter.const import CALLCENTER_USER\n from corehq.apps.domain.models import Domain\n from corehq.apps.es.domains import DomainES\n from corehq.apps.es import filters\n-from corehq.apps.hqcase.utils import submit_case_blocks\n-from corehq.apps.locations.models import SQLLocation\n-from corehq.apps.export.tasks import add_inferred_export_properties\n from corehq.form_processor.interfaces.dbaccessors import CaseAccessors\n from corehq.util.quickcache import quickcache\n from corehq.util.timezones.conversions import UserTime, ServerTime\n-from dimagi.utils.couch import CriticalSection\n-from django.core.cache import cache\n+# I'm gonna clean this up in a later commit\n+from .sync_user_case import sync_usercase, sync_call_center_user_case, sync_user_case","path":"corehq/apps/callcenter/utils.py","position":24,"original_position":24,"commit_id":"430c522ae515b91a2043cfb52a1a7b8d9993efae","original_commit_id":"430c522ae515b91a2043cfb52a1a7b8d9993efae","user":{"login":"stickler-ci","id":16011037,"node_id":"MDQ6VXNlcjE2MDExMDM3","avatar_url":"https://avatars3.githubusercontent.com/u/16011037?v=4","gravatar_id":"","url":"https://api.github.com/users/stickler-ci","html_url":"https://github.com/stickler-ci","followers_url":"https://api.github.com/users/stickler-ci/followers","following_url":"https://api.github.com/users/stickler-ci/following{/other_user}","gists_url":"https://api.github.com/users/stickler-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/stickler-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickler-ci/subscriptions","organizations_url":"https://api.github.com/users/stickler-ci/orgs","repos_url":"https://api.github.com/users/stickler-ci/repos","events_url":"https://api.github.com/users/stickler-ci/events{/privacy}","received_events_url":"https://api.github.com/users/stickler-ci/received_events","type":"User","site_admin":false},"body":"F401 '.sync_user_case.sync_user_case' imported but unused\nF401 '.sync_user_case.sync_usercase' imported but unused\nF401 '.sync_user_case.sync_call_center_user_case' imported but unused","created_at":"2018-12-11T18:04:19Z","updated_at":"2018-12-11T18:04:19Z","html_url":"https://github.com/dimagi/commcare-hq/pull/22704#discussion_r240727400","pull_request_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/22704","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/240727400"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/22704#discussion_r240727400"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/22704"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/22704","id":237775457,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3Nzc1NDU3","html_url":"https://github.com/dimagi/commcare-hq/pull/22704","diff_url":"https://github.com/dimagi/commcare-hq/pull/22704.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/22704.patch","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/22704","number":22704,"state":"open","locked":false,"title":"Sync usercase asynchronously","user":{"login":"esoergel","id":2367539,"node_id":"MDQ6VXNlcjIzNjc1Mzk=","avatar_url":"https://avatars2.githubusercontent.com/u/2367539?v=4","gravatar_id":"","url":"https://api.github.com/users/esoergel","html_url":"https://github.com/esoergel","followers_url":"https://api.github.com/users/esoergel/followers","following_url":"https://api.github.com/users/esoergel/following{/other_user}","gists_url":"https://api.github.com/users/esoergel/gists{/gist_id}","starred_url":"https://api.github.com/users/esoergel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esoergel/subscriptions","organizations_url":"https://api.github.com/users/esoergel/orgs","repos_url":"https://api.github.com/users/esoergel/repos","events_url":"https://api.github.com/users/esoergel/events{/privacy}","received_events_url":"https://api.github.com/users/esoergel/received_events","type":"User","site_admin":false},"body":"Saving a user can be very slow, particularly when reactivating.  Kishan's test user on ICDS consistently takes several minutes to save.  This moves the most expensive operation into an async task, so it won't block the UI.\r\n\r\nContext here: https://dimagi-dev.atlassian.net/browse/ICDS-16\r\n\r\nIt also moves some stuff around and renames to be clearer.  Should be straightforward to review commit-by-commit.","created_at":"2018-12-11T18:03:40Z","updated_at":"2018-12-11T18:04:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4731b59ba2d0ea060b326a75796ac1d1cb1e2d3d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":724784918,"node_id":"MDU6TGFiZWw3MjQ3ODQ5MTg=","url":"https://api.github.com/repos/dimagi/commcare-hq/labels/product/all-users-all-environments","name":"product/all-users-all-environments","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/22704/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/22704/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/22704/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/430c522ae515b91a2043cfb52a1a7b8d9993efae","head":{"label":"dimagi:es/usercase","ref":"es/usercase","sha":"430c522ae515b91a2043cfb52a1a7b8d9993efae","user":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"node_id":"MDEwOlJlcG9zaXRvcnkyNDcyNzg=","name":"commcare-hq","full_name":"dimagi/commcare-hq","private":false,"owner":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq/deployments","created_at":"2009-07-09T17:00:07Z","updated_at":"2018-12-11T16:24:24Z","pushed_at":"2018-12-11T18:03:40Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"https://www.commcarehq.org","size":475631,"stargazers_count":317,"watchers_count":317,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":123,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":123,"open_issues":73,"watchers":317,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"4739fe961721327c304d9e86c5ed326be9e42736","user":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"node_id":"MDEwOlJlcG9zaXRvcnkyNDcyNzg=","name":"commcare-hq","full_name":"dimagi/commcare-hq","private":false,"owner":{"login":"dimagi","id":94514,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NTE0","avatar_url":"https://avatars1.githubusercontent.com/u/94514?v=4","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq/deployments","created_at":"2009-07-09T17:00:07Z","updated_at":"2018-12-11T16:24:24Z","pushed_at":"2018-12-11T18:03:40Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"https://www.commcarehq.org","size":475631,"stargazers_count":317,"watchers_count":317,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":123,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":123,"open_issues":73,"watchers":317,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/22704"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/22704"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/22704"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/22704/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/22704/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/22704/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare-hq/statuses/430c522ae515b91a2043cfb52a1a7b8d9993efae"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"stickler-ci"}}