{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/7440","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/7440/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/7440/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/7440/events","html_url":"https://github.com/edx/edx-platform/pull/7440","id":63402768,"number":7440,"title":"Fixes merge conflict with account creation transaction.","user":{"login":"nasthagiri","id":6772826,"avatar_url":"https://avatars.githubusercontent.com/u/6772826?v=3","gravatar_id":"","url":"https://api.github.com/users/nasthagiri","html_url":"https://github.com/nasthagiri","followers_url":"https://api.github.com/users/nasthagiri/followers","following_url":"https://api.github.com/users/nasthagiri/following{/other_user}","gists_url":"https://api.github.com/users/nasthagiri/gists{/gist_id}","starred_url":"https://api.github.com/users/nasthagiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasthagiri/subscriptions","organizations_url":"https://api.github.com/users/nasthagiri/orgs","repos_url":"https://api.github.com/users/nasthagiri/repos","events_url":"https://api.github.com/users/nasthagiri/events{/privacy}","received_events_url":"https://api.github.com/users/nasthagiri/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-21T13:24:17Z","updated_at":"2015-03-21T18:24:40Z","closed_at":"2015-03-21T18:06:56Z","pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/7440","html_url":"https://github.com/edx/edx-platform/pull/7440","diff_url":"https://github.com/edx/edx-platform/pull/7440.diff","patch_url":"https://github.com/edx/edx-platform/pull/7440.patch"},"body":"Master is currently broken because of transaction logic introduced by the following 2 PRs:\r\nhttps://github.com/edx/edx-platform/pull/7353 (Mobile registration with Google/FB)\r\nhttps://github.com/edx/edx-platform/pull/7327 (Implement full preferences API)\r\n\r\nBroken tests on master: https://build.testeng.edx.org/job/edx-platform-all-tests-pr-flow/2296/#showFailuresLink\r\n\r\nThe `set_user_preference` call needs to be made outside of the transaction block since it has its own @transaction.commit_on_success decorator. The outer transaction is not rolled back if the inner transaction succeeds. This was an issue introduced by the addition of the call to `set_user_preference`, but it was not caught earlier since there were no unit tests to verify the transaction rollback.\r\n\r\nWith django 1.6, we'll be able to use `auto_commit`, which makes nested transactions much easier to deal with."},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/84414017","html_url":"https://github.com/edx/edx-platform/pull/7440#issuecomment-84414017","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/7440","id":84414017,"user":{"login":"cahrens","id":484484,"avatar_url":"https://avatars.githubusercontent.com/u/484484?v=3","gravatar_id":"","url":"https://api.github.com/users/cahrens","html_url":"https://github.com/cahrens","followers_url":"https://api.github.com/users/cahrens/followers","following_url":"https://api.github.com/users/cahrens/following{/other_user}","gists_url":"https://api.github.com/users/cahrens/gists{/gist_id}","starred_url":"https://api.github.com/users/cahrens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahrens/subscriptions","organizations_url":"https://api.github.com/users/cahrens/orgs","repos_url":"https://api.github.com/users/cahrens/repos","events_url":"https://api.github.com/users/cahrens/events{/privacy}","received_events_url":"https://api.github.com/users/cahrens/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T18:24:40Z","updated_at":"2015-03-21T18:24:40Z","body":"Right, @andy-armstrong unit tests will only find issues if they are specifically testing for rollback behavior. We should make sure that calls that we made to our API are not in nested transaction control blocks.\r\n\r\nWe should also examine if we have been too aggressive with the decorator. For instance, why would setting a single preference need rollback behavior? I can see it for setting multiple preferences or account fields, but I don't think it makes sense for a single preference."}}