{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/zamboni/pulls/comments/48422017","id":48422017,"diff_hunk":"@@ -38,42 +35,38 @@ class Meta:\n         model = UserProfile\n         fields = ['source', 'verified']\n \n-    def transform_source(self, obj, value):\n+    def to_representation(self, obj):\n         \"\"\"Return the sources slug instead of the id.\"\"\"\n+        data = super(AccountInfoSerializer, self).to_representation(obj)\n         if obj.pk is None:\n-            return mkt.LOGIN_SOURCE_LOOKUP[mkt.LOGIN_SOURCE_UNKNOWN]\n+            source = mkt.LOGIN_SOURCE_LOOKUP[mkt.LOGIN_SOURCE_UNKNOWN]\n         elif obj.source in self.ALLOWED_SOURCES:\n-            return mkt.LOGIN_SOURCE_LOOKUP[value]\n+            source = mkt.LOGIN_SOURCE_LOOKUP[obj.source]\n         else:\n-            return mkt.LOGIN_SOURCE_LOOKUP[mkt.LOGIN_SOURCE_BROWSERID]\n+            source = mkt.LOGIN_SOURCE_LOOKUP[mkt.LOGIN_SOURCE_BROWSERID]\n+\n+        data[\"source\"] = source\n+        return data\n \n \n class FeedbackSerializer(PotatoCaptchaSerializer):\n-    feedback = fields.CharField()\n-    platform = fields.CharField(required=False)\n+    feedback = fields.CharField(allow_blank=False)\n     chromeless = fields.CharField(required=False)\n     from_url = fields.CharField(required=False)\n-    user = fields.Field()\n+    user = fields.ReadOnlyField(required=False)\n+    platform = fields.CharField(required=False, allow_null=True)\n \n     def validate(self, attrs):\n         attrs = super(FeedbackSerializer, self).validate(attrs)\n-\n         if not attrs.get('platform'):\n             attrs['platform'] = self.request.GET.get('dev', '')\n         if self.request.user.is_authenticated():\n-            attrs['user'] = self.request.user\n+            attrs['user'] = unicode(self.request.user)","path":"mkt/account/serializers.py","position":67,"original_position":67,"commit_id":"62807e13ab91ea9faacaec9debad8d30cd59fcb0","original_commit_id":"ff26b2112f5f088dc06ce7bfb8763a4fb6130353","user":{"login":"washort","id":947487,"avatar_url":"https://avatars.githubusercontent.com/u/947487?v=3","gravatar_id":"","url":"https://api.github.com/users/washort","html_url":"https://github.com/washort","followers_url":"https://api.github.com/users/washort/followers","following_url":"https://api.github.com/users/washort/following{/other_user}","gists_url":"https://api.github.com/users/washort/gists{/gist_id}","starred_url":"https://api.github.com/users/washort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/washort/subscriptions","organizations_url":"https://api.github.com/users/washort/orgs","repos_url":"https://api.github.com/users/washort/repos","events_url":"https://api.github.com/users/washort/events{/privacy}","received_events_url":"https://api.github.com/users/washort/received_events","type":"User","site_admin":false},"body":"I just noticed this was in `validate`, not `to_representation`, which is part of why it looks so weird.","created_at":"2015-12-24T17:30:49Z","updated_at":"2015-12-24T17:30:49Z","html_url":"https://github.com/mozilla/zamboni/pull/3469#discussion_r48422017","pull_request_url":"https://api.github.com/repos/mozilla/zamboni/pulls/3469","_links":{"self":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/comments/48422017"},"html":{"href":"https://github.com/mozilla/zamboni/pull/3469#discussion_r48422017"},"pull_request":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/3469"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/zamboni/pulls/3469","id":54426894,"html_url":"https://github.com/mozilla/zamboni/pull/3469","diff_url":"https://github.com/mozilla/zamboni/pull/3469.diff","patch_url":"https://github.com/mozilla/zamboni/pull/3469.patch","issue_url":"https://api.github.com/repos/mozilla/zamboni/issues/3469","number":3469,"state":"open","locked":false,"title":"upgrade to restframework 3","user":{"login":"washort","id":947487,"avatar_url":"https://avatars.githubusercontent.com/u/947487?v=3","gravatar_id":"","url":"https://api.github.com/users/washort","html_url":"https://github.com/washort","followers_url":"https://api.github.com/users/washort/followers","following_url":"https://api.github.com/users/washort/following{/other_user}","gists_url":"https://api.github.com/users/washort/gists{/gist_id}","starred_url":"https://api.github.com/users/washort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/washort/subscriptions","organizations_url":"https://api.github.com/users/washort/orgs","repos_url":"https://api.github.com/users/washort/repos","events_url":"https://api.github.com/users/washort/events{/privacy}","received_events_url":"https://api.github.com/users/washort/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-22T23:28:00Z","updated_at":"2015-12-24T17:30:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c9211d8c1b88b786d11b2ef6864d49b4347fff6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/zamboni/pulls/3469/commits","review_comments_url":"https://api.github.com/repos/mozilla/zamboni/pulls/3469/comments","review_comment_url":"https://api.github.com/repos/mozilla/zamboni/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/zamboni/issues/3469/comments","statuses_url":"https://api.github.com/repos/mozilla/zamboni/statuses/62807e13ab91ea9faacaec9debad8d30cd59fcb0","head":{"label":"washort:restframework3","ref":"restframework3","sha":"62807e13ab91ea9faacaec9debad8d30cd59fcb0","user":{"login":"washort","id":947487,"avatar_url":"https://avatars.githubusercontent.com/u/947487?v=3","gravatar_id":"","url":"https://api.github.com/users/washort","html_url":"https://github.com/washort","followers_url":"https://api.github.com/users/washort/followers","following_url":"https://api.github.com/users/washort/following{/other_user}","gists_url":"https://api.github.com/users/washort/gists{/gist_id}","starred_url":"https://api.github.com/users/washort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/washort/subscriptions","organizations_url":"https://api.github.com/users/washort/orgs","repos_url":"https://api.github.com/users/washort/repos","events_url":"https://api.github.com/users/washort/events{/privacy}","received_events_url":"https://api.github.com/users/washort/received_events","type":"User","site_admin":false},"repo":{"id":2126060,"name":"zamboni","full_name":"washort/zamboni","owner":{"login":"washort","id":947487,"avatar_url":"https://avatars.githubusercontent.com/u/947487?v=3","gravatar_id":"","url":"https://api.github.com/users/washort","html_url":"https://github.com/washort","followers_url":"https://api.github.com/users/washort/followers","following_url":"https://api.github.com/users/washort/following{/other_user}","gists_url":"https://api.github.com/users/washort/gists{/gist_id}","starred_url":"https://api.github.com/users/washort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/washort/subscriptions","organizations_url":"https://api.github.com/users/washort/orgs","repos_url":"https://api.github.com/users/washort/repos","events_url":"https://api.github.com/users/washort/events{/privacy}","received_events_url":"https://api.github.com/users/washort/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/washort/zamboni","description":"A clandestine operation to make AMO happy","fork":true,"url":"https://api.github.com/repos/washort/zamboni","forks_url":"https://api.github.com/repos/washort/zamboni/forks","keys_url":"https://api.github.com/repos/washort/zamboni/keys{/key_id}","collaborators_url":"https://api.github.com/repos/washort/zamboni/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/washort/zamboni/teams","hooks_url":"https://api.github.com/repos/washort/zamboni/hooks","issue_events_url":"https://api.github.com/repos/washort/zamboni/issues/events{/number}","events_url":"https://api.github.com/repos/washort/zamboni/events","assignees_url":"https://api.github.com/repos/washort/zamboni/assignees{/user}","branches_url":"https://api.github.com/repos/washort/zamboni/branches{/branch}","tags_url":"https://api.github.com/repos/washort/zamboni/tags","blobs_url":"https://api.github.com/repos/washort/zamboni/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/washort/zamboni/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/washort/zamboni/git/refs{/sha}","trees_url":"https://api.github.com/repos/washort/zamboni/git/trees{/sha}","statuses_url":"https://api.github.com/repos/washort/zamboni/statuses/{sha}","languages_url":"https://api.github.com/repos/washort/zamboni/languages","stargazers_url":"https://api.github.com/repos/washort/zamboni/stargazers","contributors_url":"https://api.github.com/repos/washort/zamboni/contributors","subscribers_url":"https://api.github.com/repos/washort/zamboni/subscribers","subscription_url":"https://api.github.com/repos/washort/zamboni/subscription","commits_url":"https://api.github.com/repos/washort/zamboni/commits{/sha}","git_commits_url":"https://api.github.com/repos/washort/zamboni/git/commits{/sha}","comments_url":"https://api.github.com/repos/washort/zamboni/comments{/number}","issue_comment_url":"https://api.github.com/repos/washort/zamboni/issues/comments{/number}","contents_url":"https://api.github.com/repos/washort/zamboni/contents/{+path}","compare_url":"https://api.github.com/repos/washort/zamboni/compare/{base}...{head}","merges_url":"https://api.github.com/repos/washort/zamboni/merges","archive_url":"https://api.github.com/repos/washort/zamboni/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/washort/zamboni/downloads","issues_url":"https://api.github.com/repos/washort/zamboni/issues{/number}","pulls_url":"https://api.github.com/repos/washort/zamboni/pulls{/number}","milestones_url":"https://api.github.com/repos/washort/zamboni/milestones{/number}","notifications_url":"https://api.github.com/repos/washort/zamboni/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/washort/zamboni/labels{/name}","releases_url":"https://api.github.com/repos/washort/zamboni/releases{/id}","created_at":"2011-07-29T20:50:16Z","updated_at":"2015-03-03T00:13:01Z","pushed_at":"2015-12-24T07:39:29Z","git_url":"git://github.com/washort/zamboni.git","ssh_url":"git@github.com:washort/zamboni.git","clone_url":"https://github.com/washort/zamboni.git","svn_url":"https://github.com/washort/zamboni","homepage":"http://jbalogh.github.com/zamboni/","size":403359,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"302d024317120ff1dac96b5019100ea78e7573fb","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":347655,"name":"zamboni","full_name":"mozilla/zamboni","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/zamboni","description":"Backend for the Firefox Marketplace","fork":false,"url":"https://api.github.com/repos/mozilla/zamboni","forks_url":"https://api.github.com/repos/mozilla/zamboni/forks","keys_url":"https://api.github.com/repos/mozilla/zamboni/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/zamboni/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/zamboni/teams","hooks_url":"https://api.github.com/repos/mozilla/zamboni/hooks","issue_events_url":"https://api.github.com/repos/mozilla/zamboni/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/zamboni/events","assignees_url":"https://api.github.com/repos/mozilla/zamboni/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/zamboni/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/zamboni/tags","blobs_url":"https://api.github.com/repos/mozilla/zamboni/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/zamboni/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/zamboni/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/zamboni/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/zamboni/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/zamboni/languages","stargazers_url":"https://api.github.com/repos/mozilla/zamboni/stargazers","contributors_url":"https://api.github.com/repos/mozilla/zamboni/contributors","subscribers_url":"https://api.github.com/repos/mozilla/zamboni/subscribers","subscription_url":"https://api.github.com/repos/mozilla/zamboni/subscription","commits_url":"https://api.github.com/repos/mozilla/zamboni/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/zamboni/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/zamboni/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/zamboni/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/zamboni/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/zamboni/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/zamboni/merges","archive_url":"https://api.github.com/repos/mozilla/zamboni/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/zamboni/downloads","issues_url":"https://api.github.com/repos/mozilla/zamboni/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/zamboni/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/zamboni/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/zamboni/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/zamboni/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/zamboni/releases{/id}","created_at":"2009-10-23T19:35:34Z","updated_at":"2015-12-17T07:23:18Z","pushed_at":"2015-12-24T15:22:06Z","git_url":"git://github.com/mozilla/zamboni.git","ssh_url":"git@github.com:mozilla/zamboni.git","clone_url":"https://github.com/mozilla/zamboni.git","svn_url":"https://github.com/mozilla/zamboni","homepage":"http://marketplace.readthedocs.org/en/latest/topics/backend.html","size":416510,"stargazers_count":473,"watchers_count":473,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":255,"mirror_url":null,"open_issues_count":12,"forks":255,"open_issues":12,"watchers":473,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/3469"},"html":{"href":"https://github.com/mozilla/zamboni/pull/3469"},"issue":{"href":"https://api.github.com/repos/mozilla/zamboni/issues/3469"},"comments":{"href":"https://api.github.com/repos/mozilla/zamboni/issues/3469/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/3469/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/3469/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/zamboni/statuses/62807e13ab91ea9faacaec9debad8d30cd59fcb0"}}}}