{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/zamboni/pulls/comments/23097900","id":23097900,"diff_hunk":"@@ -0,0 +1,26 @@\n+import logging\n+from celeryutils import task\n+from mpconstants import collection_colors as coll_colors\n+\n+from mkt.feed.models import FeedApp, FeedCollection\n+\n+log = logging.getLogger('z.feed')\n+\n+\n+@task\n+def _migrate_collection_colors(ids, model):\n+    \"\"\"Migrate deprecated background color (hex) to color (name).\"\"\"\n+    cls = FeedApp\n+    if model == 'collection':\n+        cls = FeedCollection\n+\n+    for obj in cls.objects.filter(id__in=ids):\n+        if obj.background_color and not obj.color:\n+            try:\n+                color = coll_colors.COLLECTION_COLORS_REVERSE[\n+                    obj.background_color]\n+            except KeyError:\n+                continue","path":"mkt/feed/tasks.py","position":23,"original_position":23,"commit_id":"20a9fa60ea810344553a2697c430d15fac0b0474","original_commit_id":"20a9fa60ea810344553a2697c430d15fac0b0474","user":{"login":"chuckharmston","id":23885,"avatar_url":"https://avatars.githubusercontent.com/u/23885?v=3","gravatar_id":"","url":"https://api.github.com/users/chuckharmston","html_url":"https://github.com/chuckharmston","followers_url":"https://api.github.com/users/chuckharmston/followers","following_url":"https://api.github.com/users/chuckharmston/following{/other_user}","gists_url":"https://api.github.com/users/chuckharmston/gists{/gist_id}","starred_url":"https://api.github.com/users/chuckharmston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuckharmston/subscriptions","organizations_url":"https://api.github.com/users/chuckharmston/orgs","repos_url":"https://api.github.com/users/chuckharmston/repos","events_url":"https://api.github.com/users/chuckharmston/events{/privacy}","received_events_url":"https://api.github.com/users/chuckharmston/received_events","type":"User","site_admin":false},"body":"If there's a `KeyError` here, `color` will be undefined and L24 will raise a `ValidationError`, right?","created_at":"2015-01-16T18:13:37Z","updated_at":"2015-01-16T18:13:37Z","html_url":"https://github.com/mozilla/zamboni/pull/2847#discussion_r23097900","pull_request_url":"https://api.github.com/repos/mozilla/zamboni/pulls/2847","_links":{"self":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/comments/23097900"},"html":{"href":"https://github.com/mozilla/zamboni/pull/2847#discussion_r23097900"},"pull_request":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/2847"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/zamboni/pulls/2847","id":27463225,"html_url":"https://github.com/mozilla/zamboni/pull/2847","diff_url":"https://github.com/mozilla/zamboni/pull/2847.diff","patch_url":"https://github.com/mozilla/zamboni/pull/2847.patch","issue_url":"https://api.github.com/repos/mozilla/zamboni/issues/2847","number":2847,"state":"open","locked":false,"title":"deprecate hex colors to use colors from marketplace-constants for feed app/coll","user":{"login":"ngokevin","id":674727,"avatar_url":"https://avatars.githubusercontent.com/u/674727?v=3","gravatar_id":"","url":"https://api.github.com/users/ngokevin","html_url":"https://github.com/ngokevin","followers_url":"https://api.github.com/users/ngokevin/followers","following_url":"https://api.github.com/users/ngokevin/following{/other_user}","gists_url":"https://api.github.com/users/ngokevin/gists{/gist_id}","starred_url":"https://api.github.com/users/ngokevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngokevin/subscriptions","organizations_url":"https://api.github.com/users/ngokevin/orgs","repos_url":"https://api.github.com/users/ngokevin/repos","events_url":"https://api.github.com/users/ngokevin/events{/privacy}","received_events_url":"https://api.github.com/users/ngokevin/received_events","type":"User","site_admin":false},"body":"https://github.com/mozilla/transonic/pull/90\r\n\r\n- Keep background_color around until we move everything to color\r\n- Migration to migrate background_color to color for previous collections/apps","created_at":"2015-01-15T21:21:50Z","updated_at":"2015-01-16T18:13:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a35b73ef3c7854070b02155964c5c21cccbf2e6e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/zamboni/pulls/2847/commits","review_comments_url":"https://api.github.com/repos/mozilla/zamboni/pulls/2847/comments","review_comment_url":"https://api.github.com/repos/mozilla/zamboni/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla/zamboni/issues/2847/comments","statuses_url":"https://api.github.com/repos/mozilla/zamboni/statuses/20a9fa60ea810344553a2697c430d15fac0b0474","head":{"label":"ngokevin:feedcolors","ref":"feedcolors","sha":"20a9fa60ea810344553a2697c430d15fac0b0474","user":{"login":"ngokevin","id":674727,"avatar_url":"https://avatars.githubusercontent.com/u/674727?v=3","gravatar_id":"","url":"https://api.github.com/users/ngokevin","html_url":"https://github.com/ngokevin","followers_url":"https://api.github.com/users/ngokevin/followers","following_url":"https://api.github.com/users/ngokevin/following{/other_user}","gists_url":"https://api.github.com/users/ngokevin/gists{/gist_id}","starred_url":"https://api.github.com/users/ngokevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngokevin/subscriptions","organizations_url":"https://api.github.com/users/ngokevin/orgs","repos_url":"https://api.github.com/users/ngokevin/repos","events_url":"https://api.github.com/users/ngokevin/events{/privacy}","received_events_url":"https://api.github.com/users/ngokevin/received_events","type":"User","site_admin":false},"repo":{"id":4227957,"name":"zamboni","full_name":"ngokevin/zamboni","owner":{"login":"ngokevin","id":674727,"avatar_url":"https://avatars.githubusercontent.com/u/674727?v=3","gravatar_id":"","url":"https://api.github.com/users/ngokevin","html_url":"https://github.com/ngokevin","followers_url":"https://api.github.com/users/ngokevin/followers","following_url":"https://api.github.com/users/ngokevin/following{/other_user}","gists_url":"https://api.github.com/users/ngokevin/gists{/gist_id}","starred_url":"https://api.github.com/users/ngokevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngokevin/subscriptions","organizations_url":"https://api.github.com/users/ngokevin/orgs","repos_url":"https://api.github.com/users/ngokevin/repos","events_url":"https://api.github.com/users/ngokevin/events{/privacy}","received_events_url":"https://api.github.com/users/ngokevin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ngokevin/zamboni","description":"A clandestine operation to make AMO happy","fork":true,"url":"https://api.github.com/repos/ngokevin/zamboni","forks_url":"https://api.github.com/repos/ngokevin/zamboni/forks","keys_url":"https://api.github.com/repos/ngokevin/zamboni/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ngokevin/zamboni/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ngokevin/zamboni/teams","hooks_url":"https://api.github.com/repos/ngokevin/zamboni/hooks","issue_events_url":"https://api.github.com/repos/ngokevin/zamboni/issues/events{/number}","events_url":"https://api.github.com/repos/ngokevin/zamboni/events","assignees_url":"https://api.github.com/repos/ngokevin/zamboni/assignees{/user}","branches_url":"https://api.github.com/repos/ngokevin/zamboni/branches{/branch}","tags_url":"https://api.github.com/repos/ngokevin/zamboni/tags","blobs_url":"https://api.github.com/repos/ngokevin/zamboni/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ngokevin/zamboni/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ngokevin/zamboni/git/refs{/sha}","trees_url":"https://api.github.com/repos/ngokevin/zamboni/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ngokevin/zamboni/statuses/{sha}","languages_url":"https://api.github.com/repos/ngokevin/zamboni/languages","stargazers_url":"https://api.github.com/repos/ngokevin/zamboni/stargazers","contributors_url":"https://api.github.com/repos/ngokevin/zamboni/contributors","subscribers_url":"https://api.github.com/repos/ngokevin/zamboni/subscribers","subscription_url":"https://api.github.com/repos/ngokevin/zamboni/subscription","commits_url":"https://api.github.com/repos/ngokevin/zamboni/commits{/sha}","git_commits_url":"https://api.github.com/repos/ngokevin/zamboni/git/commits{/sha}","comments_url":"https://api.github.com/repos/ngokevin/zamboni/comments{/number}","issue_comment_url":"https://api.github.com/repos/ngokevin/zamboni/issues/comments/{number}","contents_url":"https://api.github.com/repos/ngokevin/zamboni/contents/{+path}","compare_url":"https://api.github.com/repos/ngokevin/zamboni/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ngokevin/zamboni/merges","archive_url":"https://api.github.com/repos/ngokevin/zamboni/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ngokevin/zamboni/downloads","issues_url":"https://api.github.com/repos/ngokevin/zamboni/issues{/number}","pulls_url":"https://api.github.com/repos/ngokevin/zamboni/pulls{/number}","milestones_url":"https://api.github.com/repos/ngokevin/zamboni/milestones{/number}","notifications_url":"https://api.github.com/repos/ngokevin/zamboni/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ngokevin/zamboni/labels{/name}","releases_url":"https://api.github.com/repos/ngokevin/zamboni/releases{/id}","created_at":"2012-05-04T18:44:23Z","updated_at":"2014-07-02T20:29:57Z","pushed_at":"2015-01-16T18:05:16Z","git_url":"git://github.com/ngokevin/zamboni.git","ssh_url":"git@github.com:ngokevin/zamboni.git","clone_url":"https://github.com/ngokevin/zamboni.git","svn_url":"https://github.com/ngokevin/zamboni","homepage":"http://mozilla.github.com/zamboni/","size":315227,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":true,"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":"577a107ab0b4a640c866a62b93394f809b9b949f","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-01-16T15:24:46Z","pushed_at":"2015-01-16T15:24:45Z","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":373038,"stargazers_count":449,"watchers_count":449,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":240,"mirror_url":null,"open_issues_count":16,"forks":240,"open_issues":16,"watchers":449,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/2847"},"html":{"href":"https://github.com/mozilla/zamboni/pull/2847"},"issue":{"href":"https://api.github.com/repos/mozilla/zamboni/issues/2847"},"comments":{"href":"https://api.github.com/repos/mozilla/zamboni/issues/2847/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/2847/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla/zamboni/pulls/2847/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/zamboni/statuses/20a9fa60ea810344553a2697c430d15fac0b0474"}}}}