{"action":"created","comment":{"url":"https://api.github.com/repos/jpcjr/corvid/pulls/comments/46231855","id":46231855,"diff_hunk":"@@ -36,8 +37,14 @@ def form_valid(self, form):\n             'project': project\n         }\n         try:\n-            category = Category.objects.create(**kwargs)\n-            category.save()\n+            # BTDubs - need to wrap this in an transaction since it could potentially cause an\n+            # exception and if it does no other queries can be executed after the error.\n+            # This causes saving the session at the end of the request to fail without wrapping in new transaction.\n+            # See this SO question/answer:\n+            # https://stackoverflow.com/questions/21458387/transactionmanagementerror-you-cant-execute-queries-until-the-end-of-the-atom\n+            with transaction.atomic():\n+                category = Category.objects.create(**kwargs)\n+                category.save()","path":"corvid/main/views/category.py","position":21,"original_position":21,"commit_id":"1a053fdc73cc20c0bac1e00b3711b5297fb170eb","original_commit_id":"1a053fdc73cc20c0bac1e00b3711b5297fb170eb","user":{"login":"jpcjr","id":2373100,"avatar_url":"https://avatars.githubusercontent.com/u/2373100?v=3","gravatar_id":"","url":"https://api.github.com/users/jpcjr","html_url":"https://github.com/jpcjr","followers_url":"https://api.github.com/users/jpcjr/followers","following_url":"https://api.github.com/users/jpcjr/following{/other_user}","gists_url":"https://api.github.com/users/jpcjr/gists{/gist_id}","starred_url":"https://api.github.com/users/jpcjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpcjr/subscriptions","organizations_url":"https://api.github.com/users/jpcjr/orgs","repos_url":"https://api.github.com/users/jpcjr/repos","events_url":"https://api.github.com/users/jpcjr/events{/privacy}","received_events_url":"https://api.github.com/users/jpcjr/received_events","type":"User","site_admin":false},"body":"*Eats another hat*. That's why tests passed with or without the transaction block.\r\n\r\nI now understand why you did this, and it looks good.\r\n\r\n\r\n","created_at":"2015-12-01T01:55:32Z","updated_at":"2015-12-01T01:55:32Z","html_url":"https://github.com/jpcjr/corvid/pull/73#discussion_r46231855","pull_request_url":"https://api.github.com/repos/jpcjr/corvid/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/jpcjr/corvid/pulls/comments/46231855"},"html":{"href":"https://github.com/jpcjr/corvid/pull/73#discussion_r46231855"},"pull_request":{"href":"https://api.github.com/repos/jpcjr/corvid/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/jpcjr/corvid/pulls/73","id":52198678,"html_url":"https://github.com/jpcjr/corvid/pull/73","diff_url":"https://github.com/jpcjr/corvid/pull/73.diff","patch_url":"https://github.com/jpcjr/corvid/pull/73.patch","issue_url":"https://api.github.com/repos/jpcjr/corvid/issues/73","number":73,"state":"open","locked":false,"title":"Added automatic session timeout","user":{"login":"dealie16","id":2313879,"avatar_url":"https://avatars.githubusercontent.com/u/2313879?v=3","gravatar_id":"","url":"https://api.github.com/users/dealie16","html_url":"https://github.com/dealie16","followers_url":"https://api.github.com/users/dealie16/followers","following_url":"https://api.github.com/users/dealie16/following{/other_user}","gists_url":"https://api.github.com/users/dealie16/gists{/gist_id}","starred_url":"https://api.github.com/users/dealie16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dealie16/subscriptions","organizations_url":"https://api.github.com/users/dealie16/orgs","repos_url":"https://api.github.com/users/dealie16/repos","events_url":"https://api.github.com/users/dealie16/events{/privacy}","received_events_url":"https://api.github.com/users/dealie16/received_events","type":"User","site_admin":false},"body":"Resolves #71 ","created_at":"2015-12-01T00:09:59Z","updated_at":"2015-12-01T01:55:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3109ccc1ec3e8adf257036bae4cf698a35adece9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jpcjr/corvid/pulls/73/commits","review_comments_url":"https://api.github.com/repos/jpcjr/corvid/pulls/73/comments","review_comment_url":"https://api.github.com/repos/jpcjr/corvid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jpcjr/corvid/issues/73/comments","statuses_url":"https://api.github.com/repos/jpcjr/corvid/statuses/1a053fdc73cc20c0bac1e00b3711b5297fb170eb","head":{"label":"jpcjr:session_expire","ref":"session_expire","sha":"1a053fdc73cc20c0bac1e00b3711b5297fb170eb","user":{"login":"jpcjr","id":2373100,"avatar_url":"https://avatars.githubusercontent.com/u/2373100?v=3","gravatar_id":"","url":"https://api.github.com/users/jpcjr","html_url":"https://github.com/jpcjr","followers_url":"https://api.github.com/users/jpcjr/followers","following_url":"https://api.github.com/users/jpcjr/following{/other_user}","gists_url":"https://api.github.com/users/jpcjr/gists{/gist_id}","starred_url":"https://api.github.com/users/jpcjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpcjr/subscriptions","organizations_url":"https://api.github.com/users/jpcjr/orgs","repos_url":"https://api.github.com/users/jpcjr/repos","events_url":"https://api.github.com/users/jpcjr/events{/privacy}","received_events_url":"https://api.github.com/users/jpcjr/received_events","type":"User","site_admin":false},"repo":{"id":42462455,"name":"corvid","full_name":"jpcjr/corvid","owner":{"login":"jpcjr","id":2373100,"avatar_url":"https://avatars.githubusercontent.com/u/2373100?v=3","gravatar_id":"","url":"https://api.github.com/users/jpcjr","html_url":"https://github.com/jpcjr","followers_url":"https://api.github.com/users/jpcjr/followers","following_url":"https://api.github.com/users/jpcjr/following{/other_user}","gists_url":"https://api.github.com/users/jpcjr/gists{/gist_id}","starred_url":"https://api.github.com/users/jpcjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpcjr/subscriptions","organizations_url":"https://api.github.com/users/jpcjr/orgs","repos_url":"https://api.github.com/users/jpcjr/repos","events_url":"https://api.github.com/users/jpcjr/events{/privacy}","received_events_url":"https://api.github.com/users/jpcjr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpcjr/corvid","description":"User-friendly static site generation. (EECS 393 Fall 2015 Course Project)","fork":false,"url":"https://api.github.com/repos/jpcjr/corvid","forks_url":"https://api.github.com/repos/jpcjr/corvid/forks","keys_url":"https://api.github.com/repos/jpcjr/corvid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpcjr/corvid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpcjr/corvid/teams","hooks_url":"https://api.github.com/repos/jpcjr/corvid/hooks","issue_events_url":"https://api.github.com/repos/jpcjr/corvid/issues/events{/number}","events_url":"https://api.github.com/repos/jpcjr/corvid/events","assignees_url":"https://api.github.com/repos/jpcjr/corvid/assignees{/user}","branches_url":"https://api.github.com/repos/jpcjr/corvid/branches{/branch}","tags_url":"https://api.github.com/repos/jpcjr/corvid/tags","blobs_url":"https://api.github.com/repos/jpcjr/corvid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpcjr/corvid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpcjr/corvid/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpcjr/corvid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpcjr/corvid/statuses/{sha}","languages_url":"https://api.github.com/repos/jpcjr/corvid/languages","stargazers_url":"https://api.github.com/repos/jpcjr/corvid/stargazers","contributors_url":"https://api.github.com/repos/jpcjr/corvid/contributors","subscribers_url":"https://api.github.com/repos/jpcjr/corvid/subscribers","subscription_url":"https://api.github.com/repos/jpcjr/corvid/subscription","commits_url":"https://api.github.com/repos/jpcjr/corvid/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpcjr/corvid/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpcjr/corvid/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpcjr/corvid/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpcjr/corvid/contents/{+path}","compare_url":"https://api.github.com/repos/jpcjr/corvid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpcjr/corvid/merges","archive_url":"https://api.github.com/repos/jpcjr/corvid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpcjr/corvid/downloads","issues_url":"https://api.github.com/repos/jpcjr/corvid/issues{/number}","pulls_url":"https://api.github.com/repos/jpcjr/corvid/pulls{/number}","milestones_url":"https://api.github.com/repos/jpcjr/corvid/milestones{/number}","notifications_url":"https://api.github.com/repos/jpcjr/corvid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpcjr/corvid/labels{/name}","releases_url":"https://api.github.com/repos/jpcjr/corvid/releases{/id}","created_at":"2015-09-14T16:47:23Z","updated_at":"2015-11-11T04:17:00Z","pushed_at":"2015-12-01T01:47:47Z","git_url":"git://github.com/jpcjr/corvid.git","ssh_url":"git@github.com:jpcjr/corvid.git","clone_url":"https://github.com/jpcjr/corvid.git","svn_url":"https://github.com/jpcjr/corvid","homepage":"","size":1637,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":2,"default_branch":"master"}},"base":{"label":"jpcjr:master","ref":"master","sha":"21ccc42c8aba99f2d096b220e5b3bbed8544b540","user":{"login":"jpcjr","id":2373100,"avatar_url":"https://avatars.githubusercontent.com/u/2373100?v=3","gravatar_id":"","url":"https://api.github.com/users/jpcjr","html_url":"https://github.com/jpcjr","followers_url":"https://api.github.com/users/jpcjr/followers","following_url":"https://api.github.com/users/jpcjr/following{/other_user}","gists_url":"https://api.github.com/users/jpcjr/gists{/gist_id}","starred_url":"https://api.github.com/users/jpcjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpcjr/subscriptions","organizations_url":"https://api.github.com/users/jpcjr/orgs","repos_url":"https://api.github.com/users/jpcjr/repos","events_url":"https://api.github.com/users/jpcjr/events{/privacy}","received_events_url":"https://api.github.com/users/jpcjr/received_events","type":"User","site_admin":false},"repo":{"id":42462455,"name":"corvid","full_name":"jpcjr/corvid","owner":{"login":"jpcjr","id":2373100,"avatar_url":"https://avatars.githubusercontent.com/u/2373100?v=3","gravatar_id":"","url":"https://api.github.com/users/jpcjr","html_url":"https://github.com/jpcjr","followers_url":"https://api.github.com/users/jpcjr/followers","following_url":"https://api.github.com/users/jpcjr/following{/other_user}","gists_url":"https://api.github.com/users/jpcjr/gists{/gist_id}","starred_url":"https://api.github.com/users/jpcjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpcjr/subscriptions","organizations_url":"https://api.github.com/users/jpcjr/orgs","repos_url":"https://api.github.com/users/jpcjr/repos","events_url":"https://api.github.com/users/jpcjr/events{/privacy}","received_events_url":"https://api.github.com/users/jpcjr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpcjr/corvid","description":"User-friendly static site generation. (EECS 393 Fall 2015 Course Project)","fork":false,"url":"https://api.github.com/repos/jpcjr/corvid","forks_url":"https://api.github.com/repos/jpcjr/corvid/forks","keys_url":"https://api.github.com/repos/jpcjr/corvid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpcjr/corvid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpcjr/corvid/teams","hooks_url":"https://api.github.com/repos/jpcjr/corvid/hooks","issue_events_url":"https://api.github.com/repos/jpcjr/corvid/issues/events{/number}","events_url":"https://api.github.com/repos/jpcjr/corvid/events","assignees_url":"https://api.github.com/repos/jpcjr/corvid/assignees{/user}","branches_url":"https://api.github.com/repos/jpcjr/corvid/branches{/branch}","tags_url":"https://api.github.com/repos/jpcjr/corvid/tags","blobs_url":"https://api.github.com/repos/jpcjr/corvid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpcjr/corvid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpcjr/corvid/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpcjr/corvid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpcjr/corvid/statuses/{sha}","languages_url":"https://api.github.com/repos/jpcjr/corvid/languages","stargazers_url":"https://api.github.com/repos/jpcjr/corvid/stargazers","contributors_url":"https://api.github.com/repos/jpcjr/corvid/contributors","subscribers_url":"https://api.github.com/repos/jpcjr/corvid/subscribers","subscription_url":"https://api.github.com/repos/jpcjr/corvid/subscription","commits_url":"https://api.github.com/repos/jpcjr/corvid/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpcjr/corvid/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpcjr/corvid/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpcjr/corvid/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpcjr/corvid/contents/{+path}","compare_url":"https://api.github.com/repos/jpcjr/corvid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpcjr/corvid/merges","archive_url":"https://api.github.com/repos/jpcjr/corvid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpcjr/corvid/downloads","issues_url":"https://api.github.com/repos/jpcjr/corvid/issues{/number}","pulls_url":"https://api.github.com/repos/jpcjr/corvid/pulls{/number}","milestones_url":"https://api.github.com/repos/jpcjr/corvid/milestones{/number}","notifications_url":"https://api.github.com/repos/jpcjr/corvid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpcjr/corvid/labels{/name}","releases_url":"https://api.github.com/repos/jpcjr/corvid/releases{/id}","created_at":"2015-09-14T16:47:23Z","updated_at":"2015-11-11T04:17:00Z","pushed_at":"2015-12-01T01:47:47Z","git_url":"git://github.com/jpcjr/corvid.git","ssh_url":"git@github.com:jpcjr/corvid.git","clone_url":"https://github.com/jpcjr/corvid.git","svn_url":"https://github.com/jpcjr/corvid","homepage":"","size":1637,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jpcjr/corvid/pulls/73"},"html":{"href":"https://github.com/jpcjr/corvid/pull/73"},"issue":{"href":"https://api.github.com/repos/jpcjr/corvid/issues/73"},"comments":{"href":"https://api.github.com/repos/jpcjr/corvid/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/jpcjr/corvid/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/jpcjr/corvid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jpcjr/corvid/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/jpcjr/corvid/statuses/1a053fdc73cc20c0bac1e00b3711b5297fb170eb"}}}}