{"action":"created","comment":{"url":"https://api.github.com/repos/learningequality/kolibri/pulls/comments/180924621","pull_request_review_id":111434029,"id":180924621,"diff_hunk":"@@ -42,6 +42,11 @@ def create(self, validated_data):\n             raise serializers.ValidationError(_('An account with that username already exists'))\n         return super(FacilityUserSerializer, self).create(validated_data)\n \n+    def update(self, instance, validated_data):\n+        if FacilityUser.objects.exclude(id__exact=instance.id).filter(username__iexact=validated_data['username']).exists():","path":"kolibri/auth/serializers.py","position":5,"original_position":5,"commit_id":"1c7b5199572f164f40c0dc96d8d169200d6d0798","original_commit_id":"1c7b5199572f164f40c0dc96d8d169200d6d0798","user":{"login":"jonboiser","id":10248067,"avatar_url":"https://avatars2.githubusercontent.com/u/10248067?v=4","gravatar_id":"","url":"https://api.github.com/users/jonboiser","html_url":"https://github.com/jonboiser","followers_url":"https://api.github.com/users/jonboiser/followers","following_url":"https://api.github.com/users/jonboiser/following{/other_user}","gists_url":"https://api.github.com/users/jonboiser/gists{/gist_id}","starred_url":"https://api.github.com/users/jonboiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonboiser/subscriptions","organizations_url":"https://api.github.com/users/jonboiser/orgs","repos_url":"https://api.github.com/users/jonboiser/repos","events_url":"https://api.github.com/users/jonboiser/events{/privacy}","received_events_url":"https://api.github.com/users/jonboiser/received_events","type":"User","site_admin":false},"body":"add something like `if 'username' in validated_data` before running this ","created_at":"2018-04-11T23:10:40Z","updated_at":"2018-04-11T23:10:40Z","html_url":"https://github.com/learningequality/kolibri/pull/3529#discussion_r180924621","pull_request_url":"https://api.github.com/repos/learningequality/kolibri/pulls/3529","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/comments/180924621"},"html":{"href":"https://github.com/learningequality/kolibri/pull/3529#discussion_r180924621"},"pull_request":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/3529"}}},"pull_request":{"url":"https://api.github.com/repos/learningequality/kolibri/pulls/3529","id":181044730,"html_url":"https://github.com/learningequality/kolibri/pull/3529","diff_url":"https://github.com/learningequality/kolibri/pull/3529.diff","patch_url":"https://github.com/learningequality/kolibri/pull/3529.patch","issue_url":"https://api.github.com/repos/learningequality/kolibri/issues/3529","number":3529,"state":"open","locked":false,"title":"Do not allow duplicate usernames","user":{"login":"christianmemije","id":7193975,"avatar_url":"https://avatars1.githubusercontent.com/u/7193975?v=4","gravatar_id":"","url":"https://api.github.com/users/christianmemije","html_url":"https://github.com/christianmemije","followers_url":"https://api.github.com/users/christianmemije/followers","following_url":"https://api.github.com/users/christianmemije/following{/other_user}","gists_url":"https://api.github.com/users/christianmemije/gists{/gist_id}","starred_url":"https://api.github.com/users/christianmemije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianmemije/subscriptions","organizations_url":"https://api.github.com/users/christianmemije/orgs","repos_url":"https://api.github.com/users/christianmemije/repos","events_url":"https://api.github.com/users/christianmemije/events{/privacy}","received_events_url":"https://api.github.com/users/christianmemije/received_events","type":"User","site_admin":false},"body":"### Summary\r\n\r\nDo not allow users to change their username to an existing one.\r\nAllow users to change the case of their username.\r\nFixes #3391\r\nShould also fix  #3476\r\n\r\n![localhost_8000_user_ ipad 3](https://user-images.githubusercontent.com/7193975/38646368-8ad08f88-3d9c-11e8-817b-5de90633c358.png)\r\n\r\n### Reviewer guidance\r\n\r\nAttempt to change your username to an existing one.\r\nChange the case of your username.\r\n\r\n----\r\n\r\n### Contributor Checklist\r\n\r\n- [x] Contributor has fully tested the PR manually\r\n- [x] PR has the correct target branch and milestone\r\n- [x] PR has 'needs review' or 'work-in-progress' label\r\n- [x] If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')\r\n- [x] If there are any front-end changes, before/after screenshots are included\r\n- [ ] If this is an important user-facing change, PR or related issue has a 'changelog' label\r\n\r\n### Reviewer Checklist\r\n\r\n- [ ] Automated test coverage is satisfactory\r\n- [ ] Reviewer has fully tested the PR manually\r\n- [ ] PR has been tested for [accessibility regressions](http://kolibri-dev.readthedocs.io/en/develop/manual_testing.html#accessibility-a11y-testing)\r\n- [ ] External dependencies files were updated (`yarn` and `pip`)\r\n- [ ] Documentation is updated\r\n- [ ] Link to diff of internal dependency change is included\r\n- [ ] CHANGELOG.rst is updated for high-level changes\r\n- [ ] Contributor is in AUTHORS.rst\r\n","created_at":"2018-04-11T22:26:01Z","updated_at":"2018-04-11T23:10:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b78c9a056a28faa67fe1a3d692eadd93af7889ba","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":410338552,"url":"https://api.github.com/repos/learningequality/kolibri/labels/PR:%20needs%20review","name":"PR: needs review","color":"1f6ad6","default":false}],"milestone":{"url":"https://api.github.com/repos/learningequality/kolibri/milestones/18","html_url":"https://github.com/learningequality/kolibri/milestone/18","labels_url":"https://api.github.com/repos/learningequality/kolibri/milestones/18/labels","id":3097289,"number":18,"title":"0.10.0","description":"","creator":{"login":"indirectlylit","id":2367265,"avatar_url":"https://avatars2.githubusercontent.com/u/2367265?v=4","gravatar_id":"","url":"https://api.github.com/users/indirectlylit","html_url":"https://github.com/indirectlylit","followers_url":"https://api.github.com/users/indirectlylit/followers","following_url":"https://api.github.com/users/indirectlylit/following{/other_user}","gists_url":"https://api.github.com/users/indirectlylit/gists{/gist_id}","starred_url":"https://api.github.com/users/indirectlylit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indirectlylit/subscriptions","organizations_url":"https://api.github.com/users/indirectlylit/orgs","repos_url":"https://api.github.com/users/indirectlylit/repos","events_url":"https://api.github.com/users/indirectlylit/events{/privacy}","received_events_url":"https://api.github.com/users/indirectlylit/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":24,"state":"open","created_at":"2018-02-07T17:08:38Z","updated_at":"2018-04-11T22:26:01Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/learningequality/kolibri/pulls/3529/commits","review_comments_url":"https://api.github.com/repos/learningequality/kolibri/pulls/3529/comments","review_comment_url":"https://api.github.com/repos/learningequality/kolibri/pulls/comments{/number}","comments_url":"https://api.github.com/repos/learningequality/kolibri/issues/3529/comments","statuses_url":"https://api.github.com/repos/learningequality/kolibri/statuses/1c7b5199572f164f40c0dc96d8d169200d6d0798","head":{"label":"christianmemije:duplicateUsernames","ref":"duplicateUsernames","sha":"1c7b5199572f164f40c0dc96d8d169200d6d0798","user":{"login":"christianmemije","id":7193975,"avatar_url":"https://avatars1.githubusercontent.com/u/7193975?v=4","gravatar_id":"","url":"https://api.github.com/users/christianmemije","html_url":"https://github.com/christianmemije","followers_url":"https://api.github.com/users/christianmemije/followers","following_url":"https://api.github.com/users/christianmemije/following{/other_user}","gists_url":"https://api.github.com/users/christianmemije/gists{/gist_id}","starred_url":"https://api.github.com/users/christianmemije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianmemije/subscriptions","organizations_url":"https://api.github.com/users/christianmemije/orgs","repos_url":"https://api.github.com/users/christianmemije/repos","events_url":"https://api.github.com/users/christianmemije/events{/privacy}","received_events_url":"https://api.github.com/users/christianmemije/received_events","type":"User","site_admin":false},"repo":{"id":62084547,"name":"kolibri","full_name":"christianmemije/kolibri","owner":{"login":"christianmemije","id":7193975,"avatar_url":"https://avatars1.githubusercontent.com/u/7193975?v=4","gravatar_id":"","url":"https://api.github.com/users/christianmemije","html_url":"https://github.com/christianmemije","followers_url":"https://api.github.com/users/christianmemije/followers","following_url":"https://api.github.com/users/christianmemije/following{/other_user}","gists_url":"https://api.github.com/users/christianmemije/gists{/gist_id}","starred_url":"https://api.github.com/users/christianmemije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianmemije/subscriptions","organizations_url":"https://api.github.com/users/christianmemije/orgs","repos_url":"https://api.github.com/users/christianmemije/repos","events_url":"https://api.github.com/users/christianmemije/events{/privacy}","received_events_url":"https://api.github.com/users/christianmemije/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/christianmemije/kolibri","description":"This is where Kolibri shall be born, watch and participate!","fork":true,"url":"https://api.github.com/repos/christianmemije/kolibri","forks_url":"https://api.github.com/repos/christianmemije/kolibri/forks","keys_url":"https://api.github.com/repos/christianmemije/kolibri/keys{/key_id}","collaborators_url":"https://api.github.com/repos/christianmemije/kolibri/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/christianmemije/kolibri/teams","hooks_url":"https://api.github.com/repos/christianmemije/kolibri/hooks","issue_events_url":"https://api.github.com/repos/christianmemije/kolibri/issues/events{/number}","events_url":"https://api.github.com/repos/christianmemije/kolibri/events","assignees_url":"https://api.github.com/repos/christianmemije/kolibri/assignees{/user}","branches_url":"https://api.github.com/repos/christianmemije/kolibri/branches{/branch}","tags_url":"https://api.github.com/repos/christianmemije/kolibri/tags","blobs_url":"https://api.github.com/repos/christianmemije/kolibri/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/christianmemije/kolibri/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/christianmemije/kolibri/git/refs{/sha}","trees_url":"https://api.github.com/repos/christianmemije/kolibri/git/trees{/sha}","statuses_url":"https://api.github.com/repos/christianmemije/kolibri/statuses/{sha}","languages_url":"https://api.github.com/repos/christianmemije/kolibri/languages","stargazers_url":"https://api.github.com/repos/christianmemije/kolibri/stargazers","contributors_url":"https://api.github.com/repos/christianmemije/kolibri/contributors","subscribers_url":"https://api.github.com/repos/christianmemije/kolibri/subscribers","subscription_url":"https://api.github.com/repos/christianmemije/kolibri/subscription","commits_url":"https://api.github.com/repos/christianmemije/kolibri/commits{/sha}","git_commits_url":"https://api.github.com/repos/christianmemije/kolibri/git/commits{/sha}","comments_url":"https://api.github.com/repos/christianmemije/kolibri/comments{/number}","issue_comment_url":"https://api.github.com/repos/christianmemije/kolibri/issues/comments{/number}","contents_url":"https://api.github.com/repos/christianmemije/kolibri/contents/{+path}","compare_url":"https://api.github.com/repos/christianmemije/kolibri/compare/{base}...{head}","merges_url":"https://api.github.com/repos/christianmemije/kolibri/merges","archive_url":"https://api.github.com/repos/christianmemije/kolibri/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/christianmemije/kolibri/downloads","issues_url":"https://api.github.com/repos/christianmemije/kolibri/issues{/number}","pulls_url":"https://api.github.com/repos/christianmemije/kolibri/pulls{/number}","milestones_url":"https://api.github.com/repos/christianmemije/kolibri/milestones{/number}","notifications_url":"https://api.github.com/repos/christianmemije/kolibri/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/christianmemije/kolibri/labels{/name}","releases_url":"https://api.github.com/repos/christianmemije/kolibri/releases{/id}","deployments_url":"https://api.github.com/repos/christianmemije/kolibri/deployments","created_at":"2016-06-27T20:07:11Z","updated_at":"2016-06-27T20:07:12Z","pushed_at":"2018-04-11T22:23:14Z","git_url":"git://github.com/christianmemije/kolibri.git","ssh_url":"git@github.com:christianmemije/kolibri.git","clone_url":"https://github.com/christianmemije/kolibri.git","svn_url":"https://github.com/christianmemije/kolibri","homepage":"http://learningequality.org/kolibri/","size":37218,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"learningequality:develop","ref":"develop","sha":"34de7c39808857d44a342a78c3962f0410129353","user":{"login":"learningequality","id":3926525,"avatar_url":"https://avatars1.githubusercontent.com/u/3926525?v=4","gravatar_id":"","url":"https://api.github.com/users/learningequality","html_url":"https://github.com/learningequality","followers_url":"https://api.github.com/users/learningequality/followers","following_url":"https://api.github.com/users/learningequality/following{/other_user}","gists_url":"https://api.github.com/users/learningequality/gists{/gist_id}","starred_url":"https://api.github.com/users/learningequality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learningequality/subscriptions","organizations_url":"https://api.github.com/users/learningequality/orgs","repos_url":"https://api.github.com/users/learningequality/repos","events_url":"https://api.github.com/users/learningequality/events{/privacy}","received_events_url":"https://api.github.com/users/learningequality/received_events","type":"Organization","site_admin":false},"repo":{"id":49976939,"name":"kolibri","full_name":"learningequality/kolibri","owner":{"login":"learningequality","id":3926525,"avatar_url":"https://avatars1.githubusercontent.com/u/3926525?v=4","gravatar_id":"","url":"https://api.github.com/users/learningequality","html_url":"https://github.com/learningequality","followers_url":"https://api.github.com/users/learningequality/followers","following_url":"https://api.github.com/users/learningequality/following{/other_user}","gists_url":"https://api.github.com/users/learningequality/gists{/gist_id}","starred_url":"https://api.github.com/users/learningequality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learningequality/subscriptions","organizations_url":"https://api.github.com/users/learningequality/orgs","repos_url":"https://api.github.com/users/learningequality/repos","events_url":"https://api.github.com/users/learningequality/events{/privacy}","received_events_url":"https://api.github.com/users/learningequality/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learningequality/kolibri","description":"Kolibri: the offline app for universal education","fork":false,"url":"https://api.github.com/repos/learningequality/kolibri","forks_url":"https://api.github.com/repos/learningequality/kolibri/forks","keys_url":"https://api.github.com/repos/learningequality/kolibri/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learningequality/kolibri/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learningequality/kolibri/teams","hooks_url":"https://api.github.com/repos/learningequality/kolibri/hooks","issue_events_url":"https://api.github.com/repos/learningequality/kolibri/issues/events{/number}","events_url":"https://api.github.com/repos/learningequality/kolibri/events","assignees_url":"https://api.github.com/repos/learningequality/kolibri/assignees{/user}","branches_url":"https://api.github.com/repos/learningequality/kolibri/branches{/branch}","tags_url":"https://api.github.com/repos/learningequality/kolibri/tags","blobs_url":"https://api.github.com/repos/learningequality/kolibri/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learningequality/kolibri/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learningequality/kolibri/git/refs{/sha}","trees_url":"https://api.github.com/repos/learningequality/kolibri/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learningequality/kolibri/statuses/{sha}","languages_url":"https://api.github.com/repos/learningequality/kolibri/languages","stargazers_url":"https://api.github.com/repos/learningequality/kolibri/stargazers","contributors_url":"https://api.github.com/repos/learningequality/kolibri/contributors","subscribers_url":"https://api.github.com/repos/learningequality/kolibri/subscribers","subscription_url":"https://api.github.com/repos/learningequality/kolibri/subscription","commits_url":"https://api.github.com/repos/learningequality/kolibri/commits{/sha}","git_commits_url":"https://api.github.com/repos/learningequality/kolibri/git/commits{/sha}","comments_url":"https://api.github.com/repos/learningequality/kolibri/comments{/number}","issue_comment_url":"https://api.github.com/repos/learningequality/kolibri/issues/comments{/number}","contents_url":"https://api.github.com/repos/learningequality/kolibri/contents/{+path}","compare_url":"https://api.github.com/repos/learningequality/kolibri/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learningequality/kolibri/merges","archive_url":"https://api.github.com/repos/learningequality/kolibri/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learningequality/kolibri/downloads","issues_url":"https://api.github.com/repos/learningequality/kolibri/issues{/number}","pulls_url":"https://api.github.com/repos/learningequality/kolibri/pulls{/number}","milestones_url":"https://api.github.com/repos/learningequality/kolibri/milestones{/number}","notifications_url":"https://api.github.com/repos/learningequality/kolibri/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learningequality/kolibri/labels{/name}","releases_url":"https://api.github.com/repos/learningequality/kolibri/releases{/id}","deployments_url":"https://api.github.com/repos/learningequality/kolibri/deployments","created_at":"2016-01-19T19:22:07Z","updated_at":"2018-04-11T21:34:15Z","pushed_at":"2018-04-11T22:26:01Z","git_url":"git://github.com/learningequality/kolibri.git","ssh_url":"git@github.com:learningequality/kolibri.git","clone_url":"https://github.com/learningequality/kolibri.git","svn_url":"https://github.com/learningequality/kolibri","homepage":"http://learningequality.org/kolibri/","size":37287,"stargazers_count":159,"watchers_count":159,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":123,"mirror_url":null,"archived":false,"open_issues_count":239,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":123,"open_issues":239,"watchers":159,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/3529"},"html":{"href":"https://github.com/learningequality/kolibri/pull/3529"},"issue":{"href":"https://api.github.com/repos/learningequality/kolibri/issues/3529"},"comments":{"href":"https://api.github.com/repos/learningequality/kolibri/issues/3529/comments"},"review_comments":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/3529/comments"},"review_comment":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/3529/commits"},"statuses":{"href":"https://api.github.com/repos/learningequality/kolibri/statuses/1c7b5199572f164f40c0dc96d8d169200d6d0798"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jonboiser"}}