{"action":"created","comment":{"url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/comments/62239609","id":62239609,"diff_hunk":"@@ -3488,15 +3467,60 @@ def calculate_presentation(self, policy=None, search_index_client=None):\n                 pool.mark_edition_primarity(primary_for_work_edition=None)\n \n \n-        # Note: policy.choose_edition is true by default.\n-        # If we don't have a self.primary_edition by now, we won't get it in \n-        # self.set_primary_edition().  That method will just set all the editions' \n+        # Note: policy.choose_edition is true in default PresentationCalculationPolicy.\n+        # If we don't have a self.primary_edition by now, this will just set all the editions' \n         # is_primary_for_work attributes to False.\n-        policy = policy or PresentationCalculationPolicy()\n         if policy.choose_edition or not self.primary_edition:\n-            self.set_primary_edition()\n+            # Tell child editions if they match work's primary edition.\n+            for edition in self.editions:\n+                if edition != self.primary_edition:\n+                    edition.is_primary_for_work = False\n+                else:\n+                    edition.is_primary_for_work = True\n+                    # let the edition know it's attached to this work now\n+                    edition.work = self\n+                    # let the edition's pool know they have a work\n+                    if edition.is_presentation_for:\n+                        edition.is_presentation_for.work = self","path":"model.py","position":144,"original_position":123,"commit_id":"542e77a2812a91ad7f10a08b5cc6509640648573","original_commit_id":"542e77a2812a91ad7f10a08b5cc6509640648573","user":{"login":"daryanypl","id":18293410,"avatar_url":"https://avatars.githubusercontent.com/u/18293410?v=3","gravatar_id":"","url":"https://api.github.com/users/daryanypl","html_url":"https://github.com/daryanypl","followers_url":"https://api.github.com/users/daryanypl/followers","following_url":"https://api.github.com/users/daryanypl/following{/other_user}","gists_url":"https://api.github.com/users/daryanypl/gists{/gist_id}","starred_url":"https://api.github.com/users/daryanypl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daryanypl/subscriptions","organizations_url":"https://api.github.com/users/daryanypl/orgs","repos_url":"https://api.github.com/users/daryanypl/repos","events_url":"https://api.github.com/users/daryanypl/events{/privacy}","received_events_url":"https://api.github.com/users/daryanypl/received_events","type":"User","site_admin":false},"body":"ok","created_at":"2016-05-05T19:20:14Z","updated_at":"2016-05-05T19:20:14Z","html_url":"https://github.com/NYPL-Simplified/server_core/pull/218#discussion_r62239609","pull_request_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/218","_links":{"self":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/comments/62239609"},"html":{"href":"https://github.com/NYPL-Simplified/server_core/pull/218#discussion_r62239609"},"pull_request":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/218"}}},"pull_request":{"url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/218","id":69024652,"html_url":"https://github.com/NYPL-Simplified/server_core/pull/218","diff_url":"https://github.com/NYPL-Simplified/server_core/pull/218.diff","patch_url":"https://github.com/NYPL-Simplified/server_core/pull/218.patch","issue_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/218","number":218,"state":"open","locked":false,"title":"made minor changes, not calculate_presentation yet","user":{"login":"daryanypl","id":18293410,"avatar_url":"https://avatars.githubusercontent.com/u/18293410?v=3","gravatar_id":"","url":"https://api.github.com/users/daryanypl","html_url":"https://github.com/daryanypl","followers_url":"https://api.github.com/users/daryanypl/followers","following_url":"https://api.github.com/users/daryanypl/following{/other_user}","gists_url":"https://api.github.com/users/daryanypl/gists{/gist_id}","starred_url":"https://api.github.com/users/daryanypl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daryanypl/subscriptions","organizations_url":"https://api.github.com/users/daryanypl/orgs","repos_url":"https://api.github.com/users/daryanypl/repos","events_url":"https://api.github.com/users/daryanypl/events{/privacy}","received_events_url":"https://api.github.com/users/daryanypl/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-05T15:37:11Z","updated_at":"2016-05-05T19:20:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75658091b7afd07eba67ff32146ca9861cc6509e","assignee":{"login":"daryanypl","id":18293410,"avatar_url":"https://avatars.githubusercontent.com/u/18293410?v=3","gravatar_id":"","url":"https://api.github.com/users/daryanypl","html_url":"https://github.com/daryanypl","followers_url":"https://api.github.com/users/daryanypl/followers","following_url":"https://api.github.com/users/daryanypl/following{/other_user}","gists_url":"https://api.github.com/users/daryanypl/gists{/gist_id}","starred_url":"https://api.github.com/users/daryanypl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daryanypl/subscriptions","organizations_url":"https://api.github.com/users/daryanypl/orgs","repos_url":"https://api.github.com/users/daryanypl/repos","events_url":"https://api.github.com/users/daryanypl/events{/privacy}","received_events_url":"https://api.github.com/users/daryanypl/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/218/commits","review_comments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/218/comments","review_comment_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/218/comments","statuses_url":"https://api.github.com/repos/NYPL-Simplified/server_core/statuses/542e77a2812a91ad7f10a08b5cc6509640648573","head":{"label":"NYPL-Simplified:pull_174_cr_fixes","ref":"pull_174_cr_fixes","sha":"542e77a2812a91ad7f10a08b5cc6509640648573","user":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"repo":{"id":27601287,"name":"server_core","full_name":"NYPL-Simplified/server_core","owner":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NYPL-Simplified/server_core","description":"Shared data model and utilities for Library Simplified server applications","fork":false,"url":"https://api.github.com/repos/NYPL-Simplified/server_core","forks_url":"https://api.github.com/repos/NYPL-Simplified/server_core/forks","keys_url":"https://api.github.com/repos/NYPL-Simplified/server_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NYPL-Simplified/server_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NYPL-Simplified/server_core/teams","hooks_url":"https://api.github.com/repos/NYPL-Simplified/server_core/hooks","issue_events_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/events{/number}","events_url":"https://api.github.com/repos/NYPL-Simplified/server_core/events","assignees_url":"https://api.github.com/repos/NYPL-Simplified/server_core/assignees{/user}","branches_url":"https://api.github.com/repos/NYPL-Simplified/server_core/branches{/branch}","tags_url":"https://api.github.com/repos/NYPL-Simplified/server_core/tags","blobs_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NYPL-Simplified/server_core/statuses/{sha}","languages_url":"https://api.github.com/repos/NYPL-Simplified/server_core/languages","stargazers_url":"https://api.github.com/repos/NYPL-Simplified/server_core/stargazers","contributors_url":"https://api.github.com/repos/NYPL-Simplified/server_core/contributors","subscribers_url":"https://api.github.com/repos/NYPL-Simplified/server_core/subscribers","subscription_url":"https://api.github.com/repos/NYPL-Simplified/server_core/subscription","commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/NYPL-Simplified/server_core/contents/{+path}","compare_url":"https://api.github.com/repos/NYPL-Simplified/server_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NYPL-Simplified/server_core/merges","archive_url":"https://api.github.com/repos/NYPL-Simplified/server_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NYPL-Simplified/server_core/downloads","issues_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues{/number}","pulls_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls{/number}","milestones_url":"https://api.github.com/repos/NYPL-Simplified/server_core/milestones{/number}","notifications_url":"https://api.github.com/repos/NYPL-Simplified/server_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NYPL-Simplified/server_core/labels{/name}","releases_url":"https://api.github.com/repos/NYPL-Simplified/server_core/releases{/id}","deployments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/deployments","created_at":"2014-12-05T17:03:04Z","updated_at":"2016-01-25T15:38:10Z","pushed_at":"2016-05-05T19:12:05Z","git_url":"git://github.com/NYPL-Simplified/server_core.git","ssh_url":"git@github.com:NYPL-Simplified/server_core.git","clone_url":"https://github.com/NYPL-Simplified/server_core.git","svn_url":"https://github.com/NYPL-Simplified/server_core","homepage":null,"size":3876,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":27,"forks":0,"open_issues":27,"watchers":0,"default_branch":"master"}},"base":{"label":"NYPL-Simplified:licensepool-superceded","ref":"licensepool-superceded","sha":"e635c0591daf84fcae5f1850f55bdaa5196789ee","user":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"repo":{"id":27601287,"name":"server_core","full_name":"NYPL-Simplified/server_core","owner":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars.githubusercontent.com/u/16416905?v=3","gravatar_id":"","url":"https://api.github.com/users/NYPL-Simplified","html_url":"https://github.com/NYPL-Simplified","followers_url":"https://api.github.com/users/NYPL-Simplified/followers","following_url":"https://api.github.com/users/NYPL-Simplified/following{/other_user}","gists_url":"https://api.github.com/users/NYPL-Simplified/gists{/gist_id}","starred_url":"https://api.github.com/users/NYPL-Simplified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NYPL-Simplified/subscriptions","organizations_url":"https://api.github.com/users/NYPL-Simplified/orgs","repos_url":"https://api.github.com/users/NYPL-Simplified/repos","events_url":"https://api.github.com/users/NYPL-Simplified/events{/privacy}","received_events_url":"https://api.github.com/users/NYPL-Simplified/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NYPL-Simplified/server_core","description":"Shared data model and utilities for Library Simplified server applications","fork":false,"url":"https://api.github.com/repos/NYPL-Simplified/server_core","forks_url":"https://api.github.com/repos/NYPL-Simplified/server_core/forks","keys_url":"https://api.github.com/repos/NYPL-Simplified/server_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NYPL-Simplified/server_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NYPL-Simplified/server_core/teams","hooks_url":"https://api.github.com/repos/NYPL-Simplified/server_core/hooks","issue_events_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/events{/number}","events_url":"https://api.github.com/repos/NYPL-Simplified/server_core/events","assignees_url":"https://api.github.com/repos/NYPL-Simplified/server_core/assignees{/user}","branches_url":"https://api.github.com/repos/NYPL-Simplified/server_core/branches{/branch}","tags_url":"https://api.github.com/repos/NYPL-Simplified/server_core/tags","blobs_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NYPL-Simplified/server_core/statuses/{sha}","languages_url":"https://api.github.com/repos/NYPL-Simplified/server_core/languages","stargazers_url":"https://api.github.com/repos/NYPL-Simplified/server_core/stargazers","contributors_url":"https://api.github.com/repos/NYPL-Simplified/server_core/contributors","subscribers_url":"https://api.github.com/repos/NYPL-Simplified/server_core/subscribers","subscription_url":"https://api.github.com/repos/NYPL-Simplified/server_core/subscription","commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/NYPL-Simplified/server_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/NYPL-Simplified/server_core/contents/{+path}","compare_url":"https://api.github.com/repos/NYPL-Simplified/server_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NYPL-Simplified/server_core/merges","archive_url":"https://api.github.com/repos/NYPL-Simplified/server_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NYPL-Simplified/server_core/downloads","issues_url":"https://api.github.com/repos/NYPL-Simplified/server_core/issues{/number}","pulls_url":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls{/number}","milestones_url":"https://api.github.com/repos/NYPL-Simplified/server_core/milestones{/number}","notifications_url":"https://api.github.com/repos/NYPL-Simplified/server_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NYPL-Simplified/server_core/labels{/name}","releases_url":"https://api.github.com/repos/NYPL-Simplified/server_core/releases{/id}","deployments_url":"https://api.github.com/repos/NYPL-Simplified/server_core/deployments","created_at":"2014-12-05T17:03:04Z","updated_at":"2016-01-25T15:38:10Z","pushed_at":"2016-05-05T19:12:05Z","git_url":"git://github.com/NYPL-Simplified/server_core.git","ssh_url":"git@github.com:NYPL-Simplified/server_core.git","clone_url":"https://github.com/NYPL-Simplified/server_core.git","svn_url":"https://github.com/NYPL-Simplified/server_core","homepage":null,"size":3876,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":27,"forks":0,"open_issues":27,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/218"},"html":{"href":"https://github.com/NYPL-Simplified/server_core/pull/218"},"issue":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/218"},"comments":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/NYPL-Simplified/server_core/statuses/542e77a2812a91ad7f10a08b5cc6509640648573"}}}}