{"action":"created","comment":{"url":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/comments/45628589","id":45628589,"diff_hunk":"@@ -54,6 +54,9 @@ def vote(request, question_id):\n             'error_message': _(\"You didn't select a choice.\"),\n         })\n     else:\n-        selected_choice.update(votes=F('votes') + 1)\n+        selected_choice.update(vote_count=F('vote_count') + 1)\n+        PollVote.objects.create(user=request.user,","path":"polls/views.py","position":31,"original_position":31,"commit_id":"b2075f96e419102dc6e20ba27b94fede669aa8e0","original_commit_id":"b2075f96e419102dc6e20ba27b94fede669aa8e0","user":{"login":"miltontony","id":623417,"avatar_url":"https://avatars.githubusercontent.com/u/623417?v=3","gravatar_id":"","url":"https://api.github.com/users/miltontony","html_url":"https://github.com/miltontony","followers_url":"https://api.github.com/users/miltontony/followers","following_url":"https://api.github.com/users/miltontony/following{/other_user}","gists_url":"https://api.github.com/users/miltontony/gists{/gist_id}","starred_url":"https://api.github.com/users/miltontony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miltontony/subscriptions","organizations_url":"https://api.github.com/users/miltontony/orgs","repos_url":"https://api.github.com/users/miltontony/repos","events_url":"https://api.github.com/users/miltontony/events{/privacy}","received_events_url":"https://api.github.com/users/miltontony/received_events","type":"User","site_admin":false},"body":"I would use a `get_or_create` here to make sure a user cannot vote twice. You should be able to figure this out with a test.","created_at":"2015-11-23T16:57:31Z","updated_at":"2015-11-23T16:57:31Z","html_url":"https://github.com/praekelt/molo-tuneme/pull/125#discussion_r45628589","pull_request_url":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/125","_links":{"self":{"href":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/comments/45628589"},"html":{"href":"https://github.com/praekelt/molo-tuneme/pull/125#discussion_r45628589"},"pull_request":{"href":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/125","id":51541618,"html_url":"https://github.com/praekelt/molo-tuneme/pull/125","diff_url":"https://github.com/praekelt/molo-tuneme/pull/125.diff","patch_url":"https://github.com/praekelt/molo-tuneme/pull/125.patch","issue_url":"https://api.github.com/repos/praekelt/molo-tuneme/issues/125","number":125,"state":"open","locked":false,"title":"correctly store user votes","user":{"login":"codiebeulaine","id":7911010,"avatar_url":"https://avatars.githubusercontent.com/u/7911010?v=3","gravatar_id":"","url":"https://api.github.com/users/codiebeulaine","html_url":"https://github.com/codiebeulaine","followers_url":"https://api.github.com/users/codiebeulaine/followers","following_url":"https://api.github.com/users/codiebeulaine/following{/other_user}","gists_url":"https://api.github.com/users/codiebeulaine/gists{/gist_id}","starred_url":"https://api.github.com/users/codiebeulaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codiebeulaine/subscriptions","organizations_url":"https://api.github.com/users/codiebeulaine/orgs","repos_url":"https://api.github.com/users/codiebeulaine/repos","events_url":"https://api.github.com/users/codiebeulaine/events{/privacy}","received_events_url":"https://api.github.com/users/codiebeulaine/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-23T15:59:50Z","updated_at":"2015-11-23T16:57:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6ff9d198abf7d6b2c4f4236096bf5cc484f533d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/125/commits","review_comments_url":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/125/comments","review_comment_url":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/comments{/number}","comments_url":"https://api.github.com/repos/praekelt/molo-tuneme/issues/125/comments","statuses_url":"https://api.github.com/repos/praekelt/molo-tuneme/statuses/b2075f96e419102dc6e20ba27b94fede669aa8e0","head":{"label":"praekelt:feature/issue-125-correctly-store-user-votes","ref":"feature/issue-125-correctly-store-user-votes","sha":"b2075f96e419102dc6e20ba27b94fede669aa8e0","user":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"repo":{"id":39822815,"name":"molo-tuneme","full_name":"praekelt/molo-tuneme","owner":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekelt/molo-tuneme","description":"wise","fork":false,"url":"https://api.github.com/repos/praekelt/molo-tuneme","forks_url":"https://api.github.com/repos/praekelt/molo-tuneme/forks","keys_url":"https://api.github.com/repos/praekelt/molo-tuneme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekelt/molo-tuneme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekelt/molo-tuneme/teams","hooks_url":"https://api.github.com/repos/praekelt/molo-tuneme/hooks","issue_events_url":"https://api.github.com/repos/praekelt/molo-tuneme/issues/events{/number}","events_url":"https://api.github.com/repos/praekelt/molo-tuneme/events","assignees_url":"https://api.github.com/repos/praekelt/molo-tuneme/assignees{/user}","branches_url":"https://api.github.com/repos/praekelt/molo-tuneme/branches{/branch}","tags_url":"https://api.github.com/repos/praekelt/molo-tuneme/tags","blobs_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekelt/molo-tuneme/statuses/{sha}","languages_url":"https://api.github.com/repos/praekelt/molo-tuneme/languages","stargazers_url":"https://api.github.com/repos/praekelt/molo-tuneme/stargazers","contributors_url":"https://api.github.com/repos/praekelt/molo-tuneme/contributors","subscribers_url":"https://api.github.com/repos/praekelt/molo-tuneme/subscribers","subscription_url":"https://api.github.com/repos/praekelt/molo-tuneme/subscription","commits_url":"https://api.github.com/repos/praekelt/molo-tuneme/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekelt/molo-tuneme/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekelt/molo-tuneme/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekelt/molo-tuneme/contents/{+path}","compare_url":"https://api.github.com/repos/praekelt/molo-tuneme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekelt/molo-tuneme/merges","archive_url":"https://api.github.com/repos/praekelt/molo-tuneme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekelt/molo-tuneme/downloads","issues_url":"https://api.github.com/repos/praekelt/molo-tuneme/issues{/number}","pulls_url":"https://api.github.com/repos/praekelt/molo-tuneme/pulls{/number}","milestones_url":"https://api.github.com/repos/praekelt/molo-tuneme/milestones{/number}","notifications_url":"https://api.github.com/repos/praekelt/molo-tuneme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekelt/molo-tuneme/labels{/name}","releases_url":"https://api.github.com/repos/praekelt/molo-tuneme/releases{/id}","created_at":"2015-07-28T08:43:13Z","updated_at":"2015-11-06T07:27:31Z","pushed_at":"2015-11-23T15:59:50Z","git_url":"git://github.com/praekelt/molo-tuneme.git","ssh_url":"git@github.com:praekelt/molo-tuneme.git","clone_url":"https://github.com/praekelt/molo-tuneme.git","svn_url":"https://github.com/praekelt/molo-tuneme","homepage":"","size":484,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":8,"forks":2,"open_issues":8,"watchers":0,"default_branch":"develop"}},"base":{"label":"praekelt:develop","ref":"develop","sha":"32711e8fdfc3c2e00ba42dec2f03cf1b0c6d073d","user":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"repo":{"id":39822815,"name":"molo-tuneme","full_name":"praekelt/molo-tuneme","owner":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekelt/molo-tuneme","description":"wise","fork":false,"url":"https://api.github.com/repos/praekelt/molo-tuneme","forks_url":"https://api.github.com/repos/praekelt/molo-tuneme/forks","keys_url":"https://api.github.com/repos/praekelt/molo-tuneme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekelt/molo-tuneme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekelt/molo-tuneme/teams","hooks_url":"https://api.github.com/repos/praekelt/molo-tuneme/hooks","issue_events_url":"https://api.github.com/repos/praekelt/molo-tuneme/issues/events{/number}","events_url":"https://api.github.com/repos/praekelt/molo-tuneme/events","assignees_url":"https://api.github.com/repos/praekelt/molo-tuneme/assignees{/user}","branches_url":"https://api.github.com/repos/praekelt/molo-tuneme/branches{/branch}","tags_url":"https://api.github.com/repos/praekelt/molo-tuneme/tags","blobs_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekelt/molo-tuneme/statuses/{sha}","languages_url":"https://api.github.com/repos/praekelt/molo-tuneme/languages","stargazers_url":"https://api.github.com/repos/praekelt/molo-tuneme/stargazers","contributors_url":"https://api.github.com/repos/praekelt/molo-tuneme/contributors","subscribers_url":"https://api.github.com/repos/praekelt/molo-tuneme/subscribers","subscription_url":"https://api.github.com/repos/praekelt/molo-tuneme/subscription","commits_url":"https://api.github.com/repos/praekelt/molo-tuneme/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekelt/molo-tuneme/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekelt/molo-tuneme/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekelt/molo-tuneme/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekelt/molo-tuneme/contents/{+path}","compare_url":"https://api.github.com/repos/praekelt/molo-tuneme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekelt/molo-tuneme/merges","archive_url":"https://api.github.com/repos/praekelt/molo-tuneme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekelt/molo-tuneme/downloads","issues_url":"https://api.github.com/repos/praekelt/molo-tuneme/issues{/number}","pulls_url":"https://api.github.com/repos/praekelt/molo-tuneme/pulls{/number}","milestones_url":"https://api.github.com/repos/praekelt/molo-tuneme/milestones{/number}","notifications_url":"https://api.github.com/repos/praekelt/molo-tuneme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekelt/molo-tuneme/labels{/name}","releases_url":"https://api.github.com/repos/praekelt/molo-tuneme/releases{/id}","created_at":"2015-07-28T08:43:13Z","updated_at":"2015-11-06T07:27:31Z","pushed_at":"2015-11-23T15:59:50Z","git_url":"git://github.com/praekelt/molo-tuneme.git","ssh_url":"git@github.com:praekelt/molo-tuneme.git","clone_url":"https://github.com/praekelt/molo-tuneme.git","svn_url":"https://github.com/praekelt/molo-tuneme","homepage":"","size":484,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":8,"forks":2,"open_issues":8,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/125"},"html":{"href":"https://github.com/praekelt/molo-tuneme/pull/125"},"issue":{"href":"https://api.github.com/repos/praekelt/molo-tuneme/issues/125"},"comments":{"href":"https://api.github.com/repos/praekelt/molo-tuneme/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/praekelt/molo-tuneme/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/praekelt/molo-tuneme/statuses/b2075f96e419102dc6e20ba27b94fede669aa8e0"}}}}