{"action":"created","comment":{"url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/comments/49054566","id":49054566,"diff_hunk":"@@ -61,8 +65,12 @@ def github_register(username:str, email:str, full_name:str, github_id:int, bio:s\n \n     if token:\n         membership = get_membership_by_token(token)\n-        membership.user = user\n-        membership.save(update_fields=[\"user\"])\n+\n+        try:\n+            membership.user = user\n+            membership.save(update_fields=[\"user\"])\n+        except IntegrityError:\n+            raise exc.IntegrityError(_(\"Membership with user already exists.\"))","path":"back/taiga_contrib_github_auth/services.py","position":null,"original_position":25,"commit_id":"080fdaffcab3d2847e61f4c5a4f041ab900bd399","original_commit_id":"c267a4dbfba1d971e90bdcff88ca549926aaad51","user":{"login":"superalex","id":1579633,"avatar_url":"https://avatars.githubusercontent.com/u/1579633?v=3","gravatar_id":"","url":"https://api.github.com/users/superalex","html_url":"https://github.com/superalex","followers_url":"https://api.github.com/users/superalex/followers","following_url":"https://api.github.com/users/superalex/following{/other_user}","gists_url":"https://api.github.com/users/superalex/gists{/gist_id}","starred_url":"https://api.github.com/users/superalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superalex/subscriptions","organizations_url":"https://api.github.com/users/superalex/orgs","repos_url":"https://api.github.com/users/superalex/repos","events_url":"https://api.github.com/users/superalex/events{/privacy}","received_events_url":"https://api.github.com/users/superalex/received_events","type":"User","site_admin":false},"body":"Updated, now it's related to this PR: https://github.com/taigaio/taiga-back/pull/563","created_at":"2016-01-07T09:24:04Z","updated_at":"2016-01-07T09:24:04Z","html_url":"https://github.com/taigaio/taiga-contrib-github-auth/pull/6#discussion_r49054566","pull_request_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/comments/49054566"},"html":{"href":"https://github.com/taigaio/taiga-contrib-github-auth/pull/6#discussion_r49054566"},"pull_request":{"href":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/6","id":55310858,"html_url":"https://github.com/taigaio/taiga-contrib-github-auth/pull/6","diff_url":"https://github.com/taigaio/taiga-contrib-github-auth/pull/6.diff","patch_url":"https://github.com/taigaio/taiga-contrib-github-auth/pull/6.patch","issue_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues/6","number":6,"state":"open","locked":false,"title":"Detect duplicated users when accepting taiga invitation","user":{"login":"superalex","id":1579633,"avatar_url":"https://avatars.githubusercontent.com/u/1579633?v=3","gravatar_id":"","url":"https://api.github.com/users/superalex","html_url":"https://github.com/superalex","followers_url":"https://api.github.com/users/superalex/followers","following_url":"https://api.github.com/users/superalex/following{/other_user}","gists_url":"https://api.github.com/users/superalex/gists{/gist_id}","starred_url":"https://api.github.com/users/superalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superalex/subscriptions","organizations_url":"https://api.github.com/users/superalex/orgs","repos_url":"https://api.github.com/users/superalex/repos","events_url":"https://api.github.com/users/superalex/events{/privacy}","received_events_url":"https://api.github.com/users/superalex/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-07T08:19:04Z","updated_at":"2016-01-07T09:24:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1894dc37c406cde388eebd5135b51af5003c475","assignee":{"login":"bameda","id":877218,"avatar_url":"https://avatars.githubusercontent.com/u/877218?v=3","gravatar_id":"","url":"https://api.github.com/users/bameda","html_url":"https://github.com/bameda","followers_url":"https://api.github.com/users/bameda/followers","following_url":"https://api.github.com/users/bameda/following{/other_user}","gists_url":"https://api.github.com/users/bameda/gists{/gist_id}","starred_url":"https://api.github.com/users/bameda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bameda/subscriptions","organizations_url":"https://api.github.com/users/bameda/orgs","repos_url":"https://api.github.com/users/bameda/repos","events_url":"https://api.github.com/users/bameda/events{/privacy}","received_events_url":"https://api.github.com/users/bameda/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/6/commits","review_comments_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/6/comments","review_comment_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues/6/comments","statuses_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/statuses/080fdaffcab3d2847e61f4c5a4f041ab900bd399","head":{"label":"taigaio:Issue-2733-duplicated-users-when-accepting-taiga-invitations","ref":"Issue-2733-duplicated-users-when-accepting-taiga-invitations","sha":"080fdaffcab3d2847e61f4c5a4f041ab900bd399","user":{"login":"taigaio","id":6905422,"avatar_url":"https://avatars.githubusercontent.com/u/6905422?v=3","gravatar_id":"","url":"https://api.github.com/users/taigaio","html_url":"https://github.com/taigaio","followers_url":"https://api.github.com/users/taigaio/followers","following_url":"https://api.github.com/users/taigaio/following{/other_user}","gists_url":"https://api.github.com/users/taigaio/gists{/gist_id}","starred_url":"https://api.github.com/users/taigaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taigaio/subscriptions","organizations_url":"https://api.github.com/users/taigaio/orgs","repos_url":"https://api.github.com/users/taigaio/repos","events_url":"https://api.github.com/users/taigaio/events{/privacy}","received_events_url":"https://api.github.com/users/taigaio/received_events","type":"Organization","site_admin":false},"repo":{"id":30589580,"name":"taiga-contrib-github-auth","full_name":"taigaio/taiga-contrib-github-auth","owner":{"login":"taigaio","id":6905422,"avatar_url":"https://avatars.githubusercontent.com/u/6905422?v=3","gravatar_id":"","url":"https://api.github.com/users/taigaio","html_url":"https://github.com/taigaio","followers_url":"https://api.github.com/users/taigaio/followers","following_url":"https://api.github.com/users/taigaio/following{/other_user}","gists_url":"https://api.github.com/users/taigaio/gists{/gist_id}","starred_url":"https://api.github.com/users/taigaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taigaio/subscriptions","organizations_url":"https://api.github.com/users/taigaio/orgs","repos_url":"https://api.github.com/users/taigaio/repos","events_url":"https://api.github.com/users/taigaio/events{/privacy}","received_events_url":"https://api.github.com/users/taigaio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taigaio/taiga-contrib-github-auth","description":"Taiga plugin for github authentication","fork":false,"url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth","forks_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/forks","keys_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/teams","hooks_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/hooks","issue_events_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues/events{/number}","events_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/events","assignees_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/assignees{/user}","branches_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/branches{/branch}","tags_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/tags","blobs_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/languages","stargazers_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/stargazers","contributors_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/contributors","subscribers_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/subscribers","subscription_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/subscription","commits_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/contents/{+path}","compare_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/merges","archive_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/downloads","issues_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues{/number}","pulls_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/labels{/name}","releases_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/releases{/id}","created_at":"2015-02-10T11:44:26Z","updated_at":"2016-01-02T13:07:55Z","pushed_at":"2016-01-07T09:23:18Z","git_url":"git://github.com/taigaio/taiga-contrib-github-auth.git","ssh_url":"git@github.com:taigaio/taiga-contrib-github-auth.git","clone_url":"https://github.com/taigaio/taiga-contrib-github-auth.git","svn_url":"https://github.com/taigaio/taiga-contrib-github-auth","homepage":"http://taiga.io","size":71,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":1,"forks":10,"open_issues":1,"watchers":6,"default_branch":"master"}},"base":{"label":"taigaio:master","ref":"master","sha":"203b3f0bd1ef65d7b52bfe4bff16ce84403b3dd4","user":{"login":"taigaio","id":6905422,"avatar_url":"https://avatars.githubusercontent.com/u/6905422?v=3","gravatar_id":"","url":"https://api.github.com/users/taigaio","html_url":"https://github.com/taigaio","followers_url":"https://api.github.com/users/taigaio/followers","following_url":"https://api.github.com/users/taigaio/following{/other_user}","gists_url":"https://api.github.com/users/taigaio/gists{/gist_id}","starred_url":"https://api.github.com/users/taigaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taigaio/subscriptions","organizations_url":"https://api.github.com/users/taigaio/orgs","repos_url":"https://api.github.com/users/taigaio/repos","events_url":"https://api.github.com/users/taigaio/events{/privacy}","received_events_url":"https://api.github.com/users/taigaio/received_events","type":"Organization","site_admin":false},"repo":{"id":30589580,"name":"taiga-contrib-github-auth","full_name":"taigaio/taiga-contrib-github-auth","owner":{"login":"taigaio","id":6905422,"avatar_url":"https://avatars.githubusercontent.com/u/6905422?v=3","gravatar_id":"","url":"https://api.github.com/users/taigaio","html_url":"https://github.com/taigaio","followers_url":"https://api.github.com/users/taigaio/followers","following_url":"https://api.github.com/users/taigaio/following{/other_user}","gists_url":"https://api.github.com/users/taigaio/gists{/gist_id}","starred_url":"https://api.github.com/users/taigaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taigaio/subscriptions","organizations_url":"https://api.github.com/users/taigaio/orgs","repos_url":"https://api.github.com/users/taigaio/repos","events_url":"https://api.github.com/users/taigaio/events{/privacy}","received_events_url":"https://api.github.com/users/taigaio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taigaio/taiga-contrib-github-auth","description":"Taiga plugin for github authentication","fork":false,"url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth","forks_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/forks","keys_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/teams","hooks_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/hooks","issue_events_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues/events{/number}","events_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/events","assignees_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/assignees{/user}","branches_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/branches{/branch}","tags_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/tags","blobs_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/languages","stargazers_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/stargazers","contributors_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/contributors","subscribers_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/subscribers","subscription_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/subscription","commits_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/contents/{+path}","compare_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/merges","archive_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/downloads","issues_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues{/number}","pulls_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/labels{/name}","releases_url":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/releases{/id}","created_at":"2015-02-10T11:44:26Z","updated_at":"2016-01-02T13:07:55Z","pushed_at":"2016-01-07T09:23:18Z","git_url":"git://github.com/taigaio/taiga-contrib-github-auth.git","ssh_url":"git@github.com:taigaio/taiga-contrib-github-auth.git","clone_url":"https://github.com/taigaio/taiga-contrib-github-auth.git","svn_url":"https://github.com/taigaio/taiga-contrib-github-auth","homepage":"http://taiga.io","size":71,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":1,"forks":10,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/6"},"html":{"href":"https://github.com/taigaio/taiga-contrib-github-auth/pull/6"},"issue":{"href":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues/6"},"comments":{"href":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/taigaio/taiga-contrib-github-auth/statuses/080fdaffcab3d2847e61f4c5a4f041ab900bd399"}}}}