{"action":"created","comment":{"url":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/comments/122797211","pull_request_review_id":44943136,"id":122797211,"diff_hunk":"@@ -536,27 +496,46 @@ def do_generate(self, lane):\n             lane_name = None\n \n         url = self.app.manager.cdn_url_for(\n-            \"feed\", languages=lane.languages, lane_name=lane_name\n+            \"feed\", languages=lane.languages, lane_name=lane_name,\n         )\n+        library = lane.library\n \n-        order_facets = self.library.enabled_facets(\n-            Facets.ORDER_FACET_GROUP_NAME\n+        default_order = library.default_facet(Facets.ORDER_FACET_GROUP_NAME)\n+        allowed_orders = library.enabled_facets(Facets.ORDER_FACET_GROUP_NAME)\n+        chosen_orders = self.orders or [default_order]\n+        \n+        default_availability = library.default_facet(\n+            Facets.AVAILABILITY_FACET_GROUP_NAME\n         )\n-        availability = self.library.default_facet(\n+        allowed_availabilities = library.enabled_facets(\n             Facets.AVAILABILITY_FACET_GROUP_NAME\n         )\n-        collection = self.library.default_facet(\n+        chosen_availabilities = self.availabilities or [default_availability]\n+        \n+        default_collection = library.default_facet(\n+            Facets.COLLECTION_FACET_GROUP_NAME\n+        )\n+        allowed_collections = library.enabled_facets(\n             Facets.COLLECTION_FACET_GROUP_NAME\n         )        \n+        chosen_collections = self.collections or [default_collection]\n+        \n+        for order in chosen_orders:\n+            if order not in allowed_orders:\n+                logging.warn(\"Ignoring unsupported ordering %s\" % order)\n+            for availability in chosen_availabilities:\n+                if availability not in allowed_availabilities:\n+                    logging.warn(\"Ignoring unsupported availability %s\" % availability)\n+\n+                for collection in chosen_collections:\n+                    if collection not in allowed_availabilities:\n+                        logging.warn(\"Ignoring unsupported collection %s\" % collection)","path":"scripts.py","position":202,"original_position":202,"commit_id":"fe02f3f08581820599ea0e97e111f88fefa24229","original_commit_id":"fe02f3f08581820599ea0e97e111f88fefa24229","user":{"login":"aslagle","id":3409215,"avatar_url":"https://avatars0.githubusercontent.com/u/3409215?v=3","gravatar_id":"","url":"https://api.github.com/users/aslagle","html_url":"https://github.com/aslagle","followers_url":"https://api.github.com/users/aslagle/followers","following_url":"https://api.github.com/users/aslagle/following{/other_user}","gists_url":"https://api.github.com/users/aslagle/gists{/gist_id}","starred_url":"https://api.github.com/users/aslagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aslagle/subscriptions","organizations_url":"https://api.github.com/users/aslagle/orgs","repos_url":"https://api.github.com/users/aslagle/repos","events_url":"https://api.github.com/users/aslagle/events{/privacy}","received_events_url":"https://api.github.com/users/aslagle/received_events","type":"User","site_admin":false},"body":"shouldn't you continue if you hit an unsupported value?","created_at":"2017-06-19T19:07:21Z","updated_at":"2017-06-19T19:07:21Z","html_url":"https://github.com/NYPL-Simplified/circulation/pull/524#discussion_r122797211","pull_request_url":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/524","_links":{"self":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/comments/122797211"},"html":{"href":"https://github.com/NYPL-Simplified/circulation/pull/524#discussion_r122797211"},"pull_request":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/524"}}},"pull_request":{"url":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/524","id":126302845,"html_url":"https://github.com/NYPL-Simplified/circulation/pull/524","diff_url":"https://github.com/NYPL-Simplified/circulation/pull/524.diff","patch_url":"https://github.com/NYPL-Simplified/circulation/pull/524.patch","issue_url":"https://api.github.com/repos/NYPL-Simplified/circulation/issues/524","number":524,"state":"open","locked":false,"title":"Stop assuming there's only one library","user":{"login":"leonardr","id":662474,"avatar_url":"https://avatars3.githubusercontent.com/u/662474?v=3","gravatar_id":"","url":"https://api.github.com/users/leonardr","html_url":"https://github.com/leonardr","followers_url":"https://api.github.com/users/leonardr/followers","following_url":"https://api.github.com/users/leonardr/following{/other_user}","gists_url":"https://api.github.com/users/leonardr/gists{/gist_id}","starred_url":"https://api.github.com/users/leonardr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonardr/subscriptions","organizations_url":"https://api.github.com/users/leonardr/orgs","repos_url":"https://api.github.com/users/leonardr/repos","events_url":"https://api.github.com/users/leonardr/events{/privacy}","received_events_url":"https://api.github.com/users/leonardr/received_events","type":"User","site_admin":false},"body":"This branch brings the circulation branch up to date with https://github.com/NYPL-Simplified/server_core/pull/525, which removes the `Library.instance()` method that lets us assume there is only ever one library.\r\n\r\nWithin the CirculationManager, we need to keep a different set of Lanes for each library and a different CirculationAPI for each library.\r\n\r\nThere's a lot of work surrounding the Adobe Vendor ID integration. Many of the tests require that a test create two libraries and configure them differently. I spent some time eliminating bad interactions with other tests, by making sure that the Adobe Vendor ID integrations aren't initialized unless they're actually needed.","created_at":"2017-06-19T13:28:35Z","updated_at":"2017-06-19T19:07:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2f610eab0d7f299e18e6ddd76b25158f238420b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/524/commits","review_comments_url":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/524/comments","review_comment_url":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NYPL-Simplified/circulation/issues/524/comments","statuses_url":"https://api.github.com/repos/NYPL-Simplified/circulation/statuses/fe02f3f08581820599ea0e97e111f88fefa24229","head":{"label":"NYPL-Simplified:no-more-default-library","ref":"no-more-default-library","sha":"fe02f3f08581820599ea0e97e111f88fefa24229","user":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars2.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":27605405,"name":"circulation","full_name":"NYPL-Simplified/circulation","owner":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars2.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/circulation","description":"Circulation manager for Library Simplified","fork":false,"url":"https://api.github.com/repos/NYPL-Simplified/circulation","forks_url":"https://api.github.com/repos/NYPL-Simplified/circulation/forks","keys_url":"https://api.github.com/repos/NYPL-Simplified/circulation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NYPL-Simplified/circulation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NYPL-Simplified/circulation/teams","hooks_url":"https://api.github.com/repos/NYPL-Simplified/circulation/hooks","issue_events_url":"https://api.github.com/repos/NYPL-Simplified/circulation/issues/events{/number}","events_url":"https://api.github.com/repos/NYPL-Simplified/circulation/events","assignees_url":"https://api.github.com/repos/NYPL-Simplified/circulation/assignees{/user}","branches_url":"https://api.github.com/repos/NYPL-Simplified/circulation/branches{/branch}","tags_url":"https://api.github.com/repos/NYPL-Simplified/circulation/tags","blobs_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/refs{/sha}","trees_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NYPL-Simplified/circulation/statuses/{sha}","languages_url":"https://api.github.com/repos/NYPL-Simplified/circulation/languages","stargazers_url":"https://api.github.com/repos/NYPL-Simplified/circulation/stargazers","contributors_url":"https://api.github.com/repos/NYPL-Simplified/circulation/contributors","subscribers_url":"https://api.github.com/repos/NYPL-Simplified/circulation/subscribers","subscription_url":"https://api.github.com/repos/NYPL-Simplified/circulation/subscription","commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation/commits{/sha}","git_commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/commits{/sha}","comments_url":"https://api.github.com/repos/NYPL-Simplified/circulation/comments{/number}","issue_comment_url":"https://api.github.com/repos/NYPL-Simplified/circulation/issues/comments{/number}","contents_url":"https://api.github.com/repos/NYPL-Simplified/circulation/contents/{+path}","compare_url":"https://api.github.com/repos/NYPL-Simplified/circulation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NYPL-Simplified/circulation/merges","archive_url":"https://api.github.com/repos/NYPL-Simplified/circulation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NYPL-Simplified/circulation/downloads","issues_url":"https://api.github.com/repos/NYPL-Simplified/circulation/issues{/number}","pulls_url":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls{/number}","milestones_url":"https://api.github.com/repos/NYPL-Simplified/circulation/milestones{/number}","notifications_url":"https://api.github.com/repos/NYPL-Simplified/circulation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NYPL-Simplified/circulation/labels{/name}","releases_url":"https://api.github.com/repos/NYPL-Simplified/circulation/releases{/id}","deployments_url":"https://api.github.com/repos/NYPL-Simplified/circulation/deployments","created_at":"2014-12-05T18:53:04Z","updated_at":"2017-05-05T06:15:37Z","pushed_at":"2017-06-19T18:23:55Z","git_url":"git://github.com/NYPL-Simplified/circulation.git","ssh_url":"git@github.com:NYPL-Simplified/circulation.git","clone_url":"https://github.com/NYPL-Simplified/circulation.git","svn_url":"https://github.com/NYPL-Simplified/circulation","homepage":null,"size":3642,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":75,"forks":7,"open_issues":75,"watchers":3,"default_branch":"master"}},"base":{"label":"NYPL-Simplified:multi-tenancy","ref":"multi-tenancy","sha":"503ced27c19571c035f56d197818562b559c65ff","user":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars2.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":27605405,"name":"circulation","full_name":"NYPL-Simplified/circulation","owner":{"login":"NYPL-Simplified","id":16416905,"avatar_url":"https://avatars2.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/circulation","description":"Circulation manager for Library Simplified","fork":false,"url":"https://api.github.com/repos/NYPL-Simplified/circulation","forks_url":"https://api.github.com/repos/NYPL-Simplified/circulation/forks","keys_url":"https://api.github.com/repos/NYPL-Simplified/circulation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NYPL-Simplified/circulation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NYPL-Simplified/circulation/teams","hooks_url":"https://api.github.com/repos/NYPL-Simplified/circulation/hooks","issue_events_url":"https://api.github.com/repos/NYPL-Simplified/circulation/issues/events{/number}","events_url":"https://api.github.com/repos/NYPL-Simplified/circulation/events","assignees_url":"https://api.github.com/repos/NYPL-Simplified/circulation/assignees{/user}","branches_url":"https://api.github.com/repos/NYPL-Simplified/circulation/branches{/branch}","tags_url":"https://api.github.com/repos/NYPL-Simplified/circulation/tags","blobs_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/refs{/sha}","trees_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NYPL-Simplified/circulation/statuses/{sha}","languages_url":"https://api.github.com/repos/NYPL-Simplified/circulation/languages","stargazers_url":"https://api.github.com/repos/NYPL-Simplified/circulation/stargazers","contributors_url":"https://api.github.com/repos/NYPL-Simplified/circulation/contributors","subscribers_url":"https://api.github.com/repos/NYPL-Simplified/circulation/subscribers","subscription_url":"https://api.github.com/repos/NYPL-Simplified/circulation/subscription","commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation/commits{/sha}","git_commits_url":"https://api.github.com/repos/NYPL-Simplified/circulation/git/commits{/sha}","comments_url":"https://api.github.com/repos/NYPL-Simplified/circulation/comments{/number}","issue_comment_url":"https://api.github.com/repos/NYPL-Simplified/circulation/issues/comments{/number}","contents_url":"https://api.github.com/repos/NYPL-Simplified/circulation/contents/{+path}","compare_url":"https://api.github.com/repos/NYPL-Simplified/circulation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NYPL-Simplified/circulation/merges","archive_url":"https://api.github.com/repos/NYPL-Simplified/circulation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NYPL-Simplified/circulation/downloads","issues_url":"https://api.github.com/repos/NYPL-Simplified/circulation/issues{/number}","pulls_url":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls{/number}","milestones_url":"https://api.github.com/repos/NYPL-Simplified/circulation/milestones{/number}","notifications_url":"https://api.github.com/repos/NYPL-Simplified/circulation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NYPL-Simplified/circulation/labels{/name}","releases_url":"https://api.github.com/repos/NYPL-Simplified/circulation/releases{/id}","deployments_url":"https://api.github.com/repos/NYPL-Simplified/circulation/deployments","created_at":"2014-12-05T18:53:04Z","updated_at":"2017-05-05T06:15:37Z","pushed_at":"2017-06-19T18:23:55Z","git_url":"git://github.com/NYPL-Simplified/circulation.git","ssh_url":"git@github.com:NYPL-Simplified/circulation.git","clone_url":"https://github.com/NYPL-Simplified/circulation.git","svn_url":"https://github.com/NYPL-Simplified/circulation","homepage":null,"size":3642,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":75,"forks":7,"open_issues":75,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/524"},"html":{"href":"https://github.com/NYPL-Simplified/circulation/pull/524"},"issue":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation/issues/524"},"comments":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation/issues/524/comments"},"review_comments":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/524/comments"},"review_comment":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation/pulls/524/commits"},"statuses":{"href":"https://api.github.com/repos/NYPL-Simplified/circulation/statuses/fe02f3f08581820599ea0e97e111f88fefa24229"}}}}
{"actor":{"display_login":"aslagle"}}