{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/kitsune/pulls/comments/27686797","id":27686797,"diff_hunk":"@@ -520,6 +520,21 @@ def review_revision(request, document_slug, revision_id):\n     revision_contributors = list(set(\n         based_on_revs.values_list('creator__username', flat=True)))\n \n+    # Get latest revision which is still not approved. Use \"latest_revision.id\" to get the id.\n+    try:\n+        latest_revision = Revision.objects.filter(\n+            document=doc,\n+            is_approved=False).order_by('-created')[0]\n+        latest_revision_id = latest_revision.id\n+    except IndexError:\n+        latest_revision_id = None\n+\n+    # Get Current Revision if \"only\" there is any approved revision.","path":"kitsune/wiki/views.py","position":13,"original_position":13,"commit_id":"15737bab22fd8aff88fb6d56030e64bd65db0795","original_commit_id":"15737bab22fd8aff88fb6d56030e64bd65db0795","user":{"login":"mythmon","id":305049,"avatar_url":"https://avatars.githubusercontent.com/u/305049?v=3","gravatar_id":"","url":"https://api.github.com/users/mythmon","html_url":"https://github.com/mythmon","followers_url":"https://api.github.com/users/mythmon/followers","following_url":"https://api.github.com/users/mythmon/following{/other_user}","gists_url":"https://api.github.com/users/mythmon/gists{/gist_id}","starred_url":"https://api.github.com/users/mythmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythmon/subscriptions","organizations_url":"https://api.github.com/users/mythmon/orgs","repos_url":"https://api.github.com/users/mythmon/repos","events_url":"https://api.github.com/users/mythmon/events{/privacy}","received_events_url":"https://api.github.com/users/mythmon/received_events","type":"User","site_admin":false},"body":"1. Don't use quotes (`\"`) for emphasis. It isn't correct. Use asterisks (`*`).\r\n2. This comment just restates the code below. That isn't very useful.","created_at":"2015-04-02T19:00:40Z","updated_at":"2015-04-02T19:00:40Z","html_url":"https://github.com/mozilla/kitsune/pull/2415#discussion_r27686797","pull_request_url":"https://api.github.com/repos/mozilla/kitsune/pulls/2415","_links":{"self":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/comments/27686797"},"html":{"href":"https://github.com/mozilla/kitsune/pull/2415#discussion_r27686797"},"pull_request":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/2415"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/kitsune/pulls/2415","id":31201475,"html_url":"https://github.com/mozilla/kitsune/pull/2415","diff_url":"https://github.com/mozilla/kitsune/pull/2415.diff","patch_url":"https://github.com/mozilla/kitsune/pull/2415.patch","issue_url":"https://api.github.com/repos/mozilla/kitsune/issues/2415","number":2415,"state":"open","locked":false,"title":"[Bug 685514] Link to review in notification mail allows to review past revision","user":{"login":"pollti","id":5623575,"avatar_url":"https://avatars.githubusercontent.com/u/5623575?v=3","gravatar_id":"","url":"https://api.github.com/users/pollti","html_url":"https://github.com/pollti","followers_url":"https://api.github.com/users/pollti/followers","following_url":"https://api.github.com/users/pollti/following{/other_user}","gists_url":"https://api.github.com/users/pollti/gists{/gist_id}","starred_url":"https://api.github.com/users/pollti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pollti/subscriptions","organizations_url":"https://api.github.com/users/pollti/orgs","repos_url":"https://api.github.com/users/pollti/repos","events_url":"https://api.github.com/users/pollti/events{/privacy}","received_events_url":"https://api.github.com/users/pollti/received_events","type":"User","site_admin":false},"body":"[[Bug 685514] Link to review in notification mail allows to review passed revision](https://bugzilla.mozilla.org/show_bug.cgi?id=685514)","created_at":"2015-03-15T15:03:14Z","updated_at":"2015-04-02T19:00:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a90c1b441b56bcd5c08e9d6438724bcd75c783ea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/kitsune/pulls/2415/commits","review_comments_url":"https://api.github.com/repos/mozilla/kitsune/pulls/2415/comments","review_comment_url":"https://api.github.com/repos/mozilla/kitsune/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/kitsune/issues/2415/comments","statuses_url":"https://api.github.com/repos/mozilla/kitsune/statuses/15737bab22fd8aff88fb6d56030e64bd65db0795","head":{"label":"pollti-tim:master","ref":"master","sha":"15737bab22fd8aff88fb6d56030e64bd65db0795","user":{"login":"pollti-tim","id":8493160,"avatar_url":"https://avatars.githubusercontent.com/u/8493160?v=3","gravatar_id":"","url":"https://api.github.com/users/pollti-tim","html_url":"https://github.com/pollti-tim","followers_url":"https://api.github.com/users/pollti-tim/followers","following_url":"https://api.github.com/users/pollti-tim/following{/other_user}","gists_url":"https://api.github.com/users/pollti-tim/gists{/gist_id}","starred_url":"https://api.github.com/users/pollti-tim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pollti-tim/subscriptions","organizations_url":"https://api.github.com/users/pollti-tim/orgs","repos_url":"https://api.github.com/users/pollti-tim/repos","events_url":"https://api.github.com/users/pollti-tim/events{/privacy}","received_events_url":"https://api.github.com/users/pollti-tim/received_events","type":"Organization","site_admin":false},"repo":{"id":32265607,"name":"kitsune","full_name":"pollti-tim/kitsune","owner":{"login":"pollti-tim","id":8493160,"avatar_url":"https://avatars.githubusercontent.com/u/8493160?v=3","gravatar_id":"","url":"https://api.github.com/users/pollti-tim","html_url":"https://github.com/pollti-tim","followers_url":"https://api.github.com/users/pollti-tim/followers","following_url":"https://api.github.com/users/pollti-tim/following{/other_user}","gists_url":"https://api.github.com/users/pollti-tim/gists{/gist_id}","starred_url":"https://api.github.com/users/pollti-tim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pollti-tim/subscriptions","organizations_url":"https://api.github.com/users/pollti-tim/orgs","repos_url":"https://api.github.com/users/pollti-tim/repos","events_url":"https://api.github.com/users/pollti-tim/events{/privacy}","received_events_url":"https://api.github.com/users/pollti-tim/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pollti-tim/kitsune","description":"Platform for Mozilla Support","fork":true,"url":"https://api.github.com/repos/pollti-tim/kitsune","forks_url":"https://api.github.com/repos/pollti-tim/kitsune/forks","keys_url":"https://api.github.com/repos/pollti-tim/kitsune/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pollti-tim/kitsune/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pollti-tim/kitsune/teams","hooks_url":"https://api.github.com/repos/pollti-tim/kitsune/hooks","issue_events_url":"https://api.github.com/repos/pollti-tim/kitsune/issues/events{/number}","events_url":"https://api.github.com/repos/pollti-tim/kitsune/events","assignees_url":"https://api.github.com/repos/pollti-tim/kitsune/assignees{/user}","branches_url":"https://api.github.com/repos/pollti-tim/kitsune/branches{/branch}","tags_url":"https://api.github.com/repos/pollti-tim/kitsune/tags","blobs_url":"https://api.github.com/repos/pollti-tim/kitsune/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pollti-tim/kitsune/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pollti-tim/kitsune/git/refs{/sha}","trees_url":"https://api.github.com/repos/pollti-tim/kitsune/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pollti-tim/kitsune/statuses/{sha}","languages_url":"https://api.github.com/repos/pollti-tim/kitsune/languages","stargazers_url":"https://api.github.com/repos/pollti-tim/kitsune/stargazers","contributors_url":"https://api.github.com/repos/pollti-tim/kitsune/contributors","subscribers_url":"https://api.github.com/repos/pollti-tim/kitsune/subscribers","subscription_url":"https://api.github.com/repos/pollti-tim/kitsune/subscription","commits_url":"https://api.github.com/repos/pollti-tim/kitsune/commits{/sha}","git_commits_url":"https://api.github.com/repos/pollti-tim/kitsune/git/commits{/sha}","comments_url":"https://api.github.com/repos/pollti-tim/kitsune/comments{/number}","issue_comment_url":"https://api.github.com/repos/pollti-tim/kitsune/issues/comments{/number}","contents_url":"https://api.github.com/repos/pollti-tim/kitsune/contents/{+path}","compare_url":"https://api.github.com/repos/pollti-tim/kitsune/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pollti-tim/kitsune/merges","archive_url":"https://api.github.com/repos/pollti-tim/kitsune/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pollti-tim/kitsune/downloads","issues_url":"https://api.github.com/repos/pollti-tim/kitsune/issues{/number}","pulls_url":"https://api.github.com/repos/pollti-tim/kitsune/pulls{/number}","milestones_url":"https://api.github.com/repos/pollti-tim/kitsune/milestones{/number}","notifications_url":"https://api.github.com/repos/pollti-tim/kitsune/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pollti-tim/kitsune/labels{/name}","releases_url":"https://api.github.com/repos/pollti-tim/kitsune/releases{/id}","created_at":"2015-03-15T14:48:22Z","updated_at":"2015-04-02T17:47:26Z","pushed_at":"2015-04-02T17:47:26Z","git_url":"git://github.com/pollti-tim/kitsune.git","ssh_url":"git@github.com:pollti-tim/kitsune.git","clone_url":"https://github.com/pollti-tim/kitsune.git","svn_url":"https://github.com/pollti-tim/kitsune","homepage":"http://support.mozilla.com/","size":92418,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"179d4e080cfa57b391dc742e903d0d6f1aeced9a","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":489645,"name":"kitsune","full_name":"mozilla/kitsune","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/kitsune","description":"Platform for Mozilla Support","fork":false,"url":"https://api.github.com/repos/mozilla/kitsune","forks_url":"https://api.github.com/repos/mozilla/kitsune/forks","keys_url":"https://api.github.com/repos/mozilla/kitsune/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/kitsune/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/kitsune/teams","hooks_url":"https://api.github.com/repos/mozilla/kitsune/hooks","issue_events_url":"https://api.github.com/repos/mozilla/kitsune/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/kitsune/events","assignees_url":"https://api.github.com/repos/mozilla/kitsune/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/kitsune/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/kitsune/tags","blobs_url":"https://api.github.com/repos/mozilla/kitsune/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/kitsune/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/kitsune/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/kitsune/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/kitsune/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/kitsune/languages","stargazers_url":"https://api.github.com/repos/mozilla/kitsune/stargazers","contributors_url":"https://api.github.com/repos/mozilla/kitsune/contributors","subscribers_url":"https://api.github.com/repos/mozilla/kitsune/subscribers","subscription_url":"https://api.github.com/repos/mozilla/kitsune/subscription","commits_url":"https://api.github.com/repos/mozilla/kitsune/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/kitsune/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/kitsune/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/kitsune/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/kitsune/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/kitsune/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/kitsune/merges","archive_url":"https://api.github.com/repos/mozilla/kitsune/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/kitsune/downloads","issues_url":"https://api.github.com/repos/mozilla/kitsune/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/kitsune/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/kitsune/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/kitsune/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/kitsune/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/kitsune/releases{/id}","created_at":"2010-01-26T18:53:57Z","updated_at":"2015-04-02T17:24:44Z","pushed_at":"2015-04-02T17:47:27Z","git_url":"git://github.com/mozilla/kitsune.git","ssh_url":"git@github.com:mozilla/kitsune.git","clone_url":"https://github.com/mozilla/kitsune.git","svn_url":"https://github.com/mozilla/kitsune","homepage":"http://support.mozilla.com/","size":177497,"stargazers_count":277,"watchers_count":277,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":264,"mirror_url":null,"open_issues_count":5,"forks":264,"open_issues":5,"watchers":277,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/2415"},"html":{"href":"https://github.com/mozilla/kitsune/pull/2415"},"issue":{"href":"https://api.github.com/repos/mozilla/kitsune/issues/2415"},"comments":{"href":"https://api.github.com/repos/mozilla/kitsune/issues/2415/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/2415/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/2415/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/kitsune/statuses/15737bab22fd8aff88fb6d56030e64bd65db0795"}}}}