{"action":"created","comment":{"url":"https://api.github.com/repos/edx/ecommerce/pulls/comments/218450691","pull_request_review_id":156390254,"id":218450691,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODQ1MDY5MQ==","diff_hunk":"@@ -0,0 +1,35 @@\n+# -*- coding: utf-8 -*-\n+# Generated by Django 1.11.15 on 2018-09-18 12:47\n+from __future__ import unicode_literals\n+\n+from django.db import migrations\n+\n+\n+def add_partner_to_conditional_offers(apps, schema_editor):\n+    ConditionalOffer = apps.get_model(\"offer\", \"ConditionalOffer\")\n+\n+    for conditional_offer in ConditionalOffer.objects.filter(date_created__year='2018', date_created__month='09'):\n+        site_configuration = conditional_offer.site.siteconfiguration if conditional_offer.site else None\n+        if site_configuration and conditional_offer.partner != site_configuration.partner:\n+            conditional_offer.partner = site_configuration.partner\n+            conditional_offer.save()\n+\n+\n+def reverse_add_partner_to_conditional_offers(apps, schema_editor):\n+    ConditionalOffer = apps.get_model(\"offer\", \"ConditionalOffer\")\n+\n+    for conditional_offer in ConditionalOffer.objects.filter(date_created__year='2018', date_created__month='09'):","path":"ecommerce/extensions/offer/migrations/0020_migrate_partner_to_coupon_offers.py","position":21,"original_position":21,"commit_id":"e038e6c573b98f9166e86920793ddfba04431892","original_commit_id":"e038e6c573b98f9166e86920793ddfba04431892","user":{"login":"waheedahmed","id":2851134,"node_id":"MDQ6VXNlcjI4NTExMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2851134?v=4","gravatar_id":"","url":"https://api.github.com/users/waheedahmed","html_url":"https://github.com/waheedahmed","followers_url":"https://api.github.com/users/waheedahmed/followers","following_url":"https://api.github.com/users/waheedahmed/following{/other_user}","gists_url":"https://api.github.com/users/waheedahmed/gists{/gist_id}","starred_url":"https://api.github.com/users/waheedahmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waheedahmed/subscriptions","organizations_url":"https://api.github.com/users/waheedahmed/orgs","repos_url":"https://api.github.com/users/waheedahmed/repos","events_url":"https://api.github.com/users/waheedahmed/events{/privacy}","received_events_url":"https://api.github.com/users/waheedahmed/received_events","type":"User","site_admin":false},"body":"@staubina I used this approach to ensure we are only updating the effected offers.","created_at":"2018-09-18T14:15:36Z","updated_at":"2018-09-18T14:15:36Z","html_url":"https://github.com/edx/ecommerce/pull/1912#discussion_r218450691","pull_request_url":"https://api.github.com/repos/edx/ecommerce/pulls/1912","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/comments/218450691"},"html":{"href":"https://github.com/edx/ecommerce/pull/1912#discussion_r218450691"},"pull_request":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/1912"}},"in_reply_to_id":218449579},"pull_request":{"url":"https://api.github.com/repos/edx/ecommerce/pulls/1912","id":216309463,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MzA5NDYz","html_url":"https://github.com/edx/ecommerce/pull/1912","diff_url":"https://github.com/edx/ecommerce/pull/1912.diff","patch_url":"https://github.com/edx/ecommerce/pull/1912.patch","issue_url":"https://api.github.com/repos/edx/ecommerce/issues/1912","number":1912,"state":"open","locked":false,"title":"Add migration to add partner to offers created in Sep, 2018.","user":{"login":"waheedahmed","id":2851134,"node_id":"MDQ6VXNlcjI4NTExMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2851134?v=4","gravatar_id":"","url":"https://api.github.com/users/waheedahmed","html_url":"https://github.com/waheedahmed","followers_url":"https://api.github.com/users/waheedahmed/followers","following_url":"https://api.github.com/users/waheedahmed/following{/other_user}","gists_url":"https://api.github.com/users/waheedahmed/gists{/gist_id}","starred_url":"https://api.github.com/users/waheedahmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waheedahmed/subscriptions","organizations_url":"https://api.github.com/users/waheedahmed/orgs","repos_url":"https://api.github.com/users/waheedahmed/repos","events_url":"https://api.github.com/users/waheedahmed/events{/privacy}","received_events_url":"https://api.github.com/users/waheedahmed/received_events","type":"User","site_admin":false},"body":"Update offers created after this PR https://github.com/edx/ecommerce/pull/1887 went live.\r\n\r\nLEARNER-6393","created_at":"2018-09-18T13:33:16Z","updated_at":"2018-09-18T14:15:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28f2ea8e31e48a79350ef5a437d3f467decbd05a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/ecommerce/pulls/1912/commits","review_comments_url":"https://api.github.com/repos/edx/ecommerce/pulls/1912/comments","review_comment_url":"https://api.github.com/repos/edx/ecommerce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/ecommerce/issues/1912/comments","statuses_url":"https://api.github.com/repos/edx/ecommerce/statuses/e038e6c573b98f9166e86920793ddfba04431892","head":{"label":"edx:waheed/LEARNER-6393-add-migartion-to-add-offers-partner","ref":"waheed/LEARNER-6393-add-migartion-to-add-offers-partner","sha":"e038e6c573b98f9166e86920793ddfba04431892","user":{"login":"edx","id":3179841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzk4NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":30175039,"node_id":"MDEwOlJlcG9zaXRvcnkzMDE3NTAzOQ==","name":"ecommerce","full_name":"edx/ecommerce","private":false,"owner":{"login":"edx","id":3179841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzk4NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/edx/ecommerce","description":"Service for managing edX's product catalog and handling orders for those products","fork":false,"url":"https://api.github.com/repos/edx/ecommerce","forks_url":"https://api.github.com/repos/edx/ecommerce/forks","keys_url":"https://api.github.com/repos/edx/ecommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/ecommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/ecommerce/teams","hooks_url":"https://api.github.com/repos/edx/ecommerce/hooks","issue_events_url":"https://api.github.com/repos/edx/ecommerce/issues/events{/number}","events_url":"https://api.github.com/repos/edx/ecommerce/events","assignees_url":"https://api.github.com/repos/edx/ecommerce/assignees{/user}","branches_url":"https://api.github.com/repos/edx/ecommerce/branches{/branch}","tags_url":"https://api.github.com/repos/edx/ecommerce/tags","blobs_url":"https://api.github.com/repos/edx/ecommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/ecommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/ecommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/ecommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/ecommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/ecommerce/languages","stargazers_url":"https://api.github.com/repos/edx/ecommerce/stargazers","contributors_url":"https://api.github.com/repos/edx/ecommerce/contributors","subscribers_url":"https://api.github.com/repos/edx/ecommerce/subscribers","subscription_url":"https://api.github.com/repos/edx/ecommerce/subscription","commits_url":"https://api.github.com/repos/edx/ecommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/ecommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/ecommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/ecommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/ecommerce/contents/{+path}","compare_url":"https://api.github.com/repos/edx/ecommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/ecommerce/merges","archive_url":"https://api.github.com/repos/edx/ecommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/ecommerce/downloads","issues_url":"https://api.github.com/repos/edx/ecommerce/issues{/number}","pulls_url":"https://api.github.com/repos/edx/ecommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/ecommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/ecommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/ecommerce/labels{/name}","releases_url":"https://api.github.com/repos/edx/ecommerce/releases{/id}","deployments_url":"https://api.github.com/repos/edx/ecommerce/deployments","created_at":"2015-02-02T06:55:15Z","updated_at":"2018-09-18T13:55:14Z","pushed_at":"2018-09-18T13:58:12Z","git_url":"git://github.com/edx/ecommerce.git","ssh_url":"git@github.com:edx/ecommerce.git","clone_url":"https://github.com/edx/ecommerce.git","svn_url":"https://github.com/edx/ecommerce","homepage":"https://edx-ecommerce.readthedocs.io/en/latest/","size":14487,"stargazers_count":79,"watchers_count":79,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":93,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":93,"open_issues":14,"watchers":79,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"d8a37dea53d72f0a48dea02c429f0658890e6766","user":{"login":"edx","id":3179841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzk4NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":30175039,"node_id":"MDEwOlJlcG9zaXRvcnkzMDE3NTAzOQ==","name":"ecommerce","full_name":"edx/ecommerce","private":false,"owner":{"login":"edx","id":3179841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzk4NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/edx/ecommerce","description":"Service for managing edX's product catalog and handling orders for those products","fork":false,"url":"https://api.github.com/repos/edx/ecommerce","forks_url":"https://api.github.com/repos/edx/ecommerce/forks","keys_url":"https://api.github.com/repos/edx/ecommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/ecommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/ecommerce/teams","hooks_url":"https://api.github.com/repos/edx/ecommerce/hooks","issue_events_url":"https://api.github.com/repos/edx/ecommerce/issues/events{/number}","events_url":"https://api.github.com/repos/edx/ecommerce/events","assignees_url":"https://api.github.com/repos/edx/ecommerce/assignees{/user}","branches_url":"https://api.github.com/repos/edx/ecommerce/branches{/branch}","tags_url":"https://api.github.com/repos/edx/ecommerce/tags","blobs_url":"https://api.github.com/repos/edx/ecommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/ecommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/ecommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/ecommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/ecommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/ecommerce/languages","stargazers_url":"https://api.github.com/repos/edx/ecommerce/stargazers","contributors_url":"https://api.github.com/repos/edx/ecommerce/contributors","subscribers_url":"https://api.github.com/repos/edx/ecommerce/subscribers","subscription_url":"https://api.github.com/repos/edx/ecommerce/subscription","commits_url":"https://api.github.com/repos/edx/ecommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/ecommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/ecommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/ecommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/ecommerce/contents/{+path}","compare_url":"https://api.github.com/repos/edx/ecommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/ecommerce/merges","archive_url":"https://api.github.com/repos/edx/ecommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/ecommerce/downloads","issues_url":"https://api.github.com/repos/edx/ecommerce/issues{/number}","pulls_url":"https://api.github.com/repos/edx/ecommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/ecommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/ecommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/ecommerce/labels{/name}","releases_url":"https://api.github.com/repos/edx/ecommerce/releases{/id}","deployments_url":"https://api.github.com/repos/edx/ecommerce/deployments","created_at":"2015-02-02T06:55:15Z","updated_at":"2018-09-18T13:55:14Z","pushed_at":"2018-09-18T13:58:12Z","git_url":"git://github.com/edx/ecommerce.git","ssh_url":"git@github.com:edx/ecommerce.git","clone_url":"https://github.com/edx/ecommerce.git","svn_url":"https://github.com/edx/ecommerce","homepage":"https://edx-ecommerce.readthedocs.io/en/latest/","size":14487,"stargazers_count":79,"watchers_count":79,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":93,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":93,"open_issues":14,"watchers":79,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/1912"},"html":{"href":"https://github.com/edx/ecommerce/pull/1912"},"issue":{"href":"https://api.github.com/repos/edx/ecommerce/issues/1912"},"comments":{"href":"https://api.github.com/repos/edx/ecommerce/issues/1912/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/1912/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/1912/commits"},"statuses":{"href":"https://api.github.com/repos/edx/ecommerce/statuses/e038e6c573b98f9166e86920793ddfba04431892"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"waheedahmed"}}