{"action":"created","comment":{"url":"https://api.github.com/repos/rapidpro/tracpro/pulls/comments/37747425","id":37747425,"diff_hunk":"@@ -108,26 +108,31 @@ def post(self, request, *args, **kwargs):\n             sent_parents = set(str(i) for i in data.values() if i is not None)\n             if sent_regions != expected_ids:\n                 msg = (\"Data must map region id to parent id for each \"\n-                       \"region in this org. \")\n-                logger.warning(\"Hierarchy: \" + msg + raw_data)\n+                       \"region in this org.\")\n+                logger.warning(\"{} Hierarchy: {} {}\".format(org, msg, raw_data))\n                 return self.error_response(400, msg)\n             elif not sent_parents.issubset(expected_ids):\n                 msg = (\"Region parent must be a region from the same org, \"\n-                       \"or null. \")\n-                logger.warning(\"Hierarchy: \" + msg + raw_data)\n+                       \"or null.\")\n+                logger.warning(\"{} Hierarchy: {} {}\".format(org, msg, raw_data))\n                 return self.error_response(400, msg)\n \n-            # Re-set parent values for each region.\n-            with Region.objects.delay_mptt_updates():\n+            # Re-set parent values for each region, then rebuild the mptt tree.\n+            with Region.objects.disable_mptt_updates():","path":"tracpro/groups/views.py","position":53,"original_position":53,"commit_id":"17a615515a61894adc37b54c67de1fded4497411","original_commit_id":"17a615515a61894adc37b54c67de1fded4497411","user":{"login":"rebecca-caktus","id":1759718,"avatar_url":"https://avatars.githubusercontent.com/u/1759718?v=3","gravatar_id":"","url":"https://api.github.com/users/rebecca-caktus","html_url":"https://github.com/rebecca-caktus","followers_url":"https://api.github.com/users/rebecca-caktus/followers","following_url":"https://api.github.com/users/rebecca-caktus/following{/other_user}","gists_url":"https://api.github.com/users/rebecca-caktus/gists{/gist_id}","starred_url":"https://api.github.com/users/rebecca-caktus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebecca-caktus/subscriptions","organizations_url":"https://api.github.com/users/rebecca-caktus/orgs","repos_url":"https://api.github.com/users/rebecca-caktus/repos","events_url":"https://api.github.com/users/rebecca-caktus/events{/privacy}","received_events_url":"https://api.github.com/users/rebecca-caktus/received_events","type":"User","site_admin":false},"body":"I am using the `@transaction.atomic` decorator on the method.","created_at":"2015-08-24T12:55:04Z","updated_at":"2015-08-24T12:55:04Z","html_url":"https://github.com/rapidpro/tracpro/pull/20#discussion_r37747425","pull_request_url":"https://api.github.com/repos/rapidpro/tracpro/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/comments/37747425"},"html":{"href":"https://github.com/rapidpro/tracpro/pull/20#discussion_r37747425"},"pull_request":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/rapidpro/tracpro/pulls/20","id":42924452,"html_url":"https://github.com/rapidpro/tracpro/pull/20","diff_url":"https://github.com/rapidpro/tracpro/pull/20.diff","patch_url":"https://github.com/rapidpro/tracpro/pull/20.patch","issue_url":"https://api.github.com/repos/rapidpro/tracpro/issues/20","number":20,"state":"open","locked":false,"title":"Hierarchical regions updates","user":{"login":"rebecca-caktus","id":1759718,"avatar_url":"https://avatars.githubusercontent.com/u/1759718?v=3","gravatar_id":"","url":"https://api.github.com/users/rebecca-caktus","html_url":"https://github.com/rebecca-caktus","followers_url":"https://api.github.com/users/rebecca-caktus/followers","following_url":"https://api.github.com/users/rebecca-caktus/following{/other_user}","gists_url":"https://api.github.com/users/rebecca-caktus/gists{/gist_id}","starred_url":"https://api.github.com/users/rebecca-caktus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebecca-caktus/subscriptions","organizations_url":"https://api.github.com/users/rebecca-caktus/orgs","repos_url":"https://api.github.com/users/rebecca-caktus/repos","events_url":"https://api.github.com/users/rebecca-caktus/events{/privacy}","received_events_url":"https://api.github.com/users/rebecca-caktus/received_events","type":"User","site_admin":false},"body":"With a few other things mixed in.\r\n\r\n* Prevent flash of un-nested content by adding \"Loading...\" text.\r\n* Fix drag & drop style issues.\r\n* Fix bug when saving regions. Some changes cause the tree to get out of sync during partial rebuilds that occur during `delay_mptt_updates`. This uses `disable_mptt_updates` to avoid all rebuilding until all changes are made.\r\n* Downgrade `pep8` and `flake8` to versions supported by `flake8`. I had noticed \"flakey\" behavior and discovered this as the cause.\r\n* Update Bootstrap to 3.3.5. While playing with glyphicons I noticed some bugs that have been fixed in the more recent version of Bootstrap. I created a [pull request](https://github.com/nyaruka/smartmin/pull/61) to update smartmin.\r\n* Beginning preparations for possibility of custom user model.","created_at":"2015-08-20T12:40:54Z","updated_at":"2015-08-24T12:55:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6afac332912a8a67b870f834bfc48a9e2eb510fa","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/rapidpro/tracpro/pulls/20/commits","review_comments_url":"https://api.github.com/repos/rapidpro/tracpro/pulls/20/comments","review_comment_url":"https://api.github.com/repos/rapidpro/tracpro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rapidpro/tracpro/issues/20/comments","statuses_url":"https://api.github.com/repos/rapidpro/tracpro/statuses/17a615515a61894adc37b54c67de1fded4497411","head":{"label":"rapidpro:hierarchical-regions-updates","ref":"hierarchical-regions-updates","sha":"17a615515a61894adc37b54c67de1fded4497411","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}","created_at":"2015-01-21T12:51:24Z","updated_at":"2015-07-21T15:58:30Z","pushed_at":"2015-08-24T12:45:21Z","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":2687,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":10,"forks":2,"open_issues":10,"watchers":1,"default_branch":"master"}},"base":{"label":"rapidpro:master","ref":"master","sha":"2c40ae1c55d0a12ec034fb7f49304ec025029762","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}","created_at":"2015-01-21T12:51:24Z","updated_at":"2015-07-21T15:58:30Z","pushed_at":"2015-08-24T12:45:21Z","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":2687,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":10,"forks":2,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/20"},"html":{"href":"https://github.com/rapidpro/tracpro/pull/20"},"issue":{"href":"https://api.github.com/repos/rapidpro/tracpro/issues/20"},"comments":{"href":"https://api.github.com/repos/rapidpro/tracpro/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rapidpro/tracpro/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/rapidpro/tracpro/statuses/17a615515a61894adc37b54c67de1fded4497411"}}}}