{"action":"created","comment":{"url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/comments/29030423","id":29030423,"diff_hunk":"@@ -45,10 +46,19 @@ def post(self, request, *args, **kwargs):\n         return self.process_request(request)\n \n     def process_request(self, request):\n+        if request.user.is_authenticated():\n+            try:\n+                lti_parameters = self._get_lti_parameters_from_request(request)\n+                if not self._right_user(request.user, lti_parameters):\n+                    _logger.debug(u\"Logging out user %s in favor of new LTI session.\", request.user.username)\n+                    logout(request)\n+            except (oauth2.Error, AttributeError):\n+                # Not a new visit, or better to keep existing auth.\n+                pass","path":"django_lti_tool_provider/views.py","position":26,"original_position":26,"commit_id":"8da086e9ad3014a58f0cc7cda14a0a5e5b054914","original_commit_id":"8da086e9ad3014a58f0cc7cda14a0a5e5b054914","user":{"login":"e-kolpakov","id":3330048,"avatar_url":"https://avatars.githubusercontent.com/u/3330048?v=3","gravatar_id":"","url":"https://api.github.com/users/e-kolpakov","html_url":"https://github.com/e-kolpakov","followers_url":"https://api.github.com/users/e-kolpakov/followers","following_url":"https://api.github.com/users/e-kolpakov/following{/other_user}","gists_url":"https://api.github.com/users/e-kolpakov/gists{/gist_id}","starred_url":"https://api.github.com/users/e-kolpakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-kolpakov/subscriptions","organizations_url":"https://api.github.com/users/e-kolpakov/orgs","repos_url":"https://api.github.com/users/e-kolpakov/repos","events_url":"https://api.github.com/users/e-kolpakov/events{/privacy}","received_events_url":"https://api.github.com/users/e-kolpakov/received_events","type":"User","site_admin":false},"body":"@Kelketek silently suppressing exceptions (and different ones) - should at lest be logged, I believe.","created_at":"2015-04-24T07:51:43Z","updated_at":"2015-04-24T07:51:43Z","html_url":"https://github.com/open-craft/django-lti-tool-provider/pull/3#discussion_r29030423","pull_request_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/comments/29030423"},"html":{"href":"https://github.com/open-craft/django-lti-tool-provider/pull/3#discussion_r29030423"},"pull_request":{"href":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/3","id":33997923,"html_url":"https://github.com/open-craft/django-lti-tool-provider/pull/3","diff_url":"https://github.com/open-craft/django-lti-tool-provider/pull/3.diff","patch_url":"https://github.com/open-craft/django-lti-tool-provider/pull/3.patch","issue_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues/3","number":3,"state":"closed","locked":false,"title":"Don't attach LTI info to pre-existing users.","user":{"login":"Kelketek","id":1099483,"avatar_url":"https://avatars.githubusercontent.com/u/1099483?v=3","gravatar_id":"","url":"https://api.github.com/users/Kelketek","html_url":"https://github.com/Kelketek","followers_url":"https://api.github.com/users/Kelketek/followers","following_url":"https://api.github.com/users/Kelketek/following{/other_user}","gists_url":"https://api.github.com/users/Kelketek/gists{/gist_id}","starred_url":"https://api.github.com/users/Kelketek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kelketek/subscriptions","organizations_url":"https://api.github.com/users/Kelketek/orgs","repos_url":"https://api.github.com/users/Kelketek/repos","events_url":"https://api.github.com/users/Kelketek/events{/privacy}","received_events_url":"https://api.github.com/users/Kelketek/received_events","type":"User","site_admin":false},"body":"@e-kolpakov @smarnach Please take a look at these changes.\r\n\r\nThese changes make it to where if a user exists already and does not have LTI info on them, they should be logged out so that the proper authentication course can begin. If the user really was the right one, the existing mechanisms should log them back in while updating LTI data. If it wasn't, it will create the new user as needed.","created_at":"2015-04-23T21:19:17Z","updated_at":"2015-04-24T07:51:43Z","closed_at":"2015-04-23T22:36:28Z","merged_at":"2015-04-23T22:36:28Z","merge_commit_sha":"9540e6c4bb3711a0a3c3c3a9377445529e8ec944","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/3/commits","review_comments_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/3/comments","review_comment_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues/3/comments","statuses_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/statuses/8da086e9ad3014a58f0cc7cda14a0a5e5b054914","head":{"label":"open-craft:user-attachment","ref":"user-attachment","sha":"8da086e9ad3014a58f0cc7cda14a0a5e5b054914","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":33990947,"name":"django-lti-tool-provider","full_name":"open-craft/django-lti-tool-provider","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/django-lti-tool-provider","description":"LTI Tool Provider DJango Application","fork":false,"url":"https://api.github.com/repos/open-craft/django-lti-tool-provider","forks_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/forks","keys_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/teams","hooks_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/hooks","issue_events_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/events","assignees_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/tags","blobs_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/languages","stargazers_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/stargazers","contributors_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/contributors","subscribers_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/subscribers","subscription_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/subscription","commits_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/merges","archive_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/downloads","issues_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/releases{/id}","created_at":"2015-04-15T11:54:31Z","updated_at":"2015-04-23T22:36:29Z","pushed_at":"2015-04-23T22:36:29Z","git_url":"git://github.com/open-craft/django-lti-tool-provider.git","ssh_url":"git@github.com:open-craft/django-lti-tool-provider.git","clone_url":"https://github.com/open-craft/django-lti-tool-provider.git","svn_url":"https://github.com/open-craft/django-lti-tool-provider","homepage":null,"size":224,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"open-craft:master","ref":"master","sha":"420f7bd3011a69c46f7f7ce9dc53e8d8aafe1af9","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":33990947,"name":"django-lti-tool-provider","full_name":"open-craft/django-lti-tool-provider","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/django-lti-tool-provider","description":"LTI Tool Provider DJango Application","fork":false,"url":"https://api.github.com/repos/open-craft/django-lti-tool-provider","forks_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/forks","keys_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/teams","hooks_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/hooks","issue_events_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/events","assignees_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/tags","blobs_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/languages","stargazers_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/stargazers","contributors_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/contributors","subscribers_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/subscribers","subscription_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/subscription","commits_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/merges","archive_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/downloads","issues_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/django-lti-tool-provider/releases{/id}","created_at":"2015-04-15T11:54:31Z","updated_at":"2015-04-23T22:36:29Z","pushed_at":"2015-04-23T22:36:29Z","git_url":"git://github.com/open-craft/django-lti-tool-provider.git","ssh_url":"git@github.com:open-craft/django-lti-tool-provider.git","clone_url":"https://github.com/open-craft/django-lti-tool-provider.git","svn_url":"https://github.com/open-craft/django-lti-tool-provider","homepage":null,"size":224,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/3"},"html":{"href":"https://github.com/open-craft/django-lti-tool-provider/pull/3"},"issue":{"href":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues/3"},"comments":{"href":"https://api.github.com/repos/open-craft/django-lti-tool-provider/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-craft/django-lti-tool-provider/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/open-craft/django-lti-tool-provider/statuses/8da086e9ad3014a58f0cc7cda14a0a5e5b054914"}}}}