{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/socorro/pulls/comments/31651985","id":31651985,"diff_hunk":"@@ -43,7 +46,17 @@ def pass_default_context(view):\n     def inner(request, *args, **kwargs):\n         product = kwargs.get('product', None)\n         versions = kwargs.get('versions', None)\n-        kwargs['default_context'] = utils.build_default_context(product,\n-                                                                versions)\n+        user_authenticated = request.user.is_authenticated()\n+        try:\n+            kwargs['default_context'] = utils.build_default_context(\n+                product,\n+                versions,\n+                user_authenticated\n+            )\n+        except utils.MissingProductError:\n+            return redirect(\n+                reverse('manage:products') + '?' +\n+                urllib.urlencode({'product': product})","path":"webapp-django/crashstats/crashstats/decorators.py","position":26,"original_position":26,"commit_id":"bc7c566b69be0524c7418bc1d2734d8d59831e0b","original_commit_id":"bc7c566b69be0524c7418bc1d2734d8d59831e0b","user":{"login":"AdrianGaudebert","id":328790,"avatar_url":"https://avatars.githubusercontent.com/u/328790?v=3","gravatar_id":"","url":"https://api.github.com/users/AdrianGaudebert","html_url":"https://github.com/AdrianGaudebert","followers_url":"https://api.github.com/users/AdrianGaudebert/followers","following_url":"https://api.github.com/users/AdrianGaudebert/following{/other_user}","gists_url":"https://api.github.com/users/AdrianGaudebert/gists{/gist_id}","starred_url":"https://api.github.com/users/AdrianGaudebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdrianGaudebert/subscriptions","organizations_url":"https://api.github.com/users/AdrianGaudebert/orgs","repos_url":"https://api.github.com/users/AdrianGaudebert/repos","events_url":"https://api.github.com/users/AdrianGaudebert/events{/privacy}","received_events_url":"https://api.github.com/users/AdrianGaudebert/received_events","type":"User","site_admin":false},"body":"You don't need to build that URL yourself. Take a look at the examples here: https://docs.djangoproject.com/en/1.6/topics/http/shortcuts/#examples You can do something like ``redirect('url', product=product)``. This way you don't need to use urllib, and it's easier to maintain. ","created_at":"2015-06-03T18:09:47Z","updated_at":"2015-06-03T18:09:47Z","html_url":"https://github.com/mozilla/socorro/pull/2828#discussion_r31651985","pull_request_url":"https://api.github.com/repos/mozilla/socorro/pulls/2828","_links":{"self":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/comments/31651985"},"html":{"href":"https://github.com/mozilla/socorro/pull/2828#discussion_r31651985"},"pull_request":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/2828"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/socorro/pulls/2828","id":36840382,"html_url":"https://github.com/mozilla/socorro/pull/2828","diff_url":"https://github.com/mozilla/socorro/pull/2828.diff","patch_url":"https://github.com/mozilla/socorro/pull/2828.patch","issue_url":"https://api.github.com/repos/mozilla/socorro/issues/2828","number":2828,"state":"open","locked":false,"title":"Fixes bug 1066881 - redirect if product is missing and user is logged in","user":{"login":"Tchanders","id":10440647,"avatar_url":"https://avatars.githubusercontent.com/u/10440647?v=3","gravatar_id":"","url":"https://api.github.com/users/Tchanders","html_url":"https://github.com/Tchanders","followers_url":"https://api.github.com/users/Tchanders/followers","following_url":"https://api.github.com/users/Tchanders/following{/other_user}","gists_url":"https://api.github.com/users/Tchanders/gists{/gist_id}","starred_url":"https://api.github.com/users/Tchanders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tchanders/subscriptions","organizations_url":"https://api.github.com/users/Tchanders/orgs","repos_url":"https://api.github.com/users/Tchanders/repos","events_url":"https://api.github.com/users/Tchanders/events{/privacy}","received_events_url":"https://api.github.com/users/Tchanders/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-03T14:48:10Z","updated_at":"2015-06-03T18:09:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1acb91f663663905531946c29d0bc50359ad418a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/socorro/pulls/2828/commits","review_comments_url":"https://api.github.com/repos/mozilla/socorro/pulls/2828/comments","review_comment_url":"https://api.github.com/repos/mozilla/socorro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/socorro/issues/2828/comments","statuses_url":"https://api.github.com/repos/mozilla/socorro/statuses/bc7c566b69be0524c7418bc1d2734d8d59831e0b","head":{"label":"Tchanders:productredirect","ref":"productredirect","sha":"bc7c566b69be0524c7418bc1d2734d8d59831e0b","user":{"login":"Tchanders","id":10440647,"avatar_url":"https://avatars.githubusercontent.com/u/10440647?v=3","gravatar_id":"","url":"https://api.github.com/users/Tchanders","html_url":"https://github.com/Tchanders","followers_url":"https://api.github.com/users/Tchanders/followers","following_url":"https://api.github.com/users/Tchanders/following{/other_user}","gists_url":"https://api.github.com/users/Tchanders/gists{/gist_id}","starred_url":"https://api.github.com/users/Tchanders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tchanders/subscriptions","organizations_url":"https://api.github.com/users/Tchanders/orgs","repos_url":"https://api.github.com/users/Tchanders/repos","events_url":"https://api.github.com/users/Tchanders/events{/privacy}","received_events_url":"https://api.github.com/users/Tchanders/received_events","type":"User","site_admin":false},"repo":{"id":33243554,"name":"socorro","full_name":"Tchanders/socorro","owner":{"login":"Tchanders","id":10440647,"avatar_url":"https://avatars.githubusercontent.com/u/10440647?v=3","gravatar_id":"","url":"https://api.github.com/users/Tchanders","html_url":"https://github.com/Tchanders","followers_url":"https://api.github.com/users/Tchanders/followers","following_url":"https://api.github.com/users/Tchanders/following{/other_user}","gists_url":"https://api.github.com/users/Tchanders/gists{/gist_id}","starred_url":"https://api.github.com/users/Tchanders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tchanders/subscriptions","organizations_url":"https://api.github.com/users/Tchanders/orgs","repos_url":"https://api.github.com/users/Tchanders/repos","events_url":"https://api.github.com/users/Tchanders/events{/privacy}","received_events_url":"https://api.github.com/users/Tchanders/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Tchanders/socorro","description":"Socorro is a server to accept and process Breakpad crash reports. ","fork":true,"url":"https://api.github.com/repos/Tchanders/socorro","forks_url":"https://api.github.com/repos/Tchanders/socorro/forks","keys_url":"https://api.github.com/repos/Tchanders/socorro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tchanders/socorro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tchanders/socorro/teams","hooks_url":"https://api.github.com/repos/Tchanders/socorro/hooks","issue_events_url":"https://api.github.com/repos/Tchanders/socorro/issues/events{/number}","events_url":"https://api.github.com/repos/Tchanders/socorro/events","assignees_url":"https://api.github.com/repos/Tchanders/socorro/assignees{/user}","branches_url":"https://api.github.com/repos/Tchanders/socorro/branches{/branch}","tags_url":"https://api.github.com/repos/Tchanders/socorro/tags","blobs_url":"https://api.github.com/repos/Tchanders/socorro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tchanders/socorro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tchanders/socorro/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tchanders/socorro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tchanders/socorro/statuses/{sha}","languages_url":"https://api.github.com/repos/Tchanders/socorro/languages","stargazers_url":"https://api.github.com/repos/Tchanders/socorro/stargazers","contributors_url":"https://api.github.com/repos/Tchanders/socorro/contributors","subscribers_url":"https://api.github.com/repos/Tchanders/socorro/subscribers","subscription_url":"https://api.github.com/repos/Tchanders/socorro/subscription","commits_url":"https://api.github.com/repos/Tchanders/socorro/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tchanders/socorro/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tchanders/socorro/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tchanders/socorro/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tchanders/socorro/contents/{+path}","compare_url":"https://api.github.com/repos/Tchanders/socorro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tchanders/socorro/merges","archive_url":"https://api.github.com/repos/Tchanders/socorro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tchanders/socorro/downloads","issues_url":"https://api.github.com/repos/Tchanders/socorro/issues{/number}","pulls_url":"https://api.github.com/repos/Tchanders/socorro/pulls{/number}","milestones_url":"https://api.github.com/repos/Tchanders/socorro/milestones{/number}","notifications_url":"https://api.github.com/repos/Tchanders/socorro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tchanders/socorro/labels{/name}","releases_url":"https://api.github.com/repos/Tchanders/socorro/releases{/id}","created_at":"2015-04-01T11:20:26Z","updated_at":"2015-05-06T21:48:02Z","pushed_at":"2015-06-03T14:43:39Z","git_url":"git://github.com/Tchanders/socorro.git","ssh_url":"git@github.com:Tchanders/socorro.git","clone_url":"https://github.com/Tchanders/socorro.git","svn_url":"https://github.com/Tchanders/socorro","homepage":"https://wiki.mozilla.org/Socorro","size":159969,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"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":"5e08e2725fedcc5b0206e0db4e32dcb0782926ff","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":2263742,"name":"socorro","full_name":"mozilla/socorro","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/socorro","description":"Socorro is a server to accept and process Breakpad crash reports. ","fork":false,"url":"https://api.github.com/repos/mozilla/socorro","forks_url":"https://api.github.com/repos/mozilla/socorro/forks","keys_url":"https://api.github.com/repos/mozilla/socorro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/socorro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/socorro/teams","hooks_url":"https://api.github.com/repos/mozilla/socorro/hooks","issue_events_url":"https://api.github.com/repos/mozilla/socorro/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/socorro/events","assignees_url":"https://api.github.com/repos/mozilla/socorro/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/socorro/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/socorro/tags","blobs_url":"https://api.github.com/repos/mozilla/socorro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/socorro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/socorro/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/socorro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/socorro/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/socorro/languages","stargazers_url":"https://api.github.com/repos/mozilla/socorro/stargazers","contributors_url":"https://api.github.com/repos/mozilla/socorro/contributors","subscribers_url":"https://api.github.com/repos/mozilla/socorro/subscribers","subscription_url":"https://api.github.com/repos/mozilla/socorro/subscription","commits_url":"https://api.github.com/repos/mozilla/socorro/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/socorro/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/socorro/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/socorro/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/socorro/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/socorro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/socorro/merges","archive_url":"https://api.github.com/repos/mozilla/socorro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/socorro/downloads","issues_url":"https://api.github.com/repos/mozilla/socorro/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/socorro/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/socorro/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/socorro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/socorro/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/socorro/releases{/id}","created_at":"2011-08-24T19:21:49Z","updated_at":"2015-06-03T14:13:30Z","pushed_at":"2015-06-03T14:48:10Z","git_url":"git://github.com/mozilla/socorro.git","ssh_url":"git@github.com:mozilla/socorro.git","clone_url":"https://github.com/mozilla/socorro.git","svn_url":"https://github.com/mozilla/socorro","homepage":"https://wiki.mozilla.org/Socorro","size":192831,"stargazers_count":227,"watchers_count":227,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":122,"mirror_url":null,"open_issues_count":3,"forks":122,"open_issues":3,"watchers":227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/2828"},"html":{"href":"https://github.com/mozilla/socorro/pull/2828"},"issue":{"href":"https://api.github.com/repos/mozilla/socorro/issues/2828"},"comments":{"href":"https://api.github.com/repos/mozilla/socorro/issues/2828/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/2828/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/socorro/pulls/2828/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/socorro/statuses/bc7c566b69be0524c7418bc1d2734d8d59831e0b"}}}}