{"action":"created","comment":{"url":"https://api.github.com/repos/edx/course-discovery/pulls/comments/83942952","pull_request_review_id":4753322,"id":83942952,"diff_hunk":"@@ -366,7 +366,9 @@ class CourseRun(TimeStampedModel):\n \n     @property\n     def program_types(self):\n-        return [program.type.name for program in self.programs.all()]\n+        # Exclude unpublished programs from list so we don't identify that program type if not available\n+        all_programs = [program for program in self.programs.all() if program.status != ProgramStatus.Unpublished]","path":"course_discovery/apps/course_metadata/models.py","position":6,"original_position":6,"commit_id":"118a82b7aeb4b6c42155e0b1625ac76cd90b4eae","original_commit_id":"118a82b7aeb4b6c42155e0b1625ac76cd90b4eae","user":{"login":"clintonb","id":910510,"avatar_url":"https://avatars.githubusercontent.com/u/910510?v=3","gravatar_id":"","url":"https://api.github.com/users/clintonb","html_url":"https://github.com/clintonb","followers_url":"https://api.github.com/users/clintonb/followers","following_url":"https://api.github.com/users/clintonb/following{/other_user}","gists_url":"https://api.github.com/users/clintonb/gists{/gist_id}","starred_url":"https://api.github.com/users/clintonb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clintonb/subscriptions","organizations_url":"https://api.github.com/users/clintonb/orgs","repos_url":"https://api.github.com/users/clintonb/repos","events_url":"https://api.github.com/users/clintonb/events{/privacy}","received_events_url":"https://api.github.com/users/clintonb/received_events","type":"User","site_admin":false},"body":"Combine into a single loop. ","created_at":"2016-10-18T20:26:30Z","updated_at":"2016-10-18T20:26:30Z","html_url":"https://github.com/edx/course-discovery/pull/389#discussion_r83942952","pull_request_url":"https://api.github.com/repos/edx/course-discovery/pulls/389","_links":{"self":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/comments/83942952"},"html":{"href":"https://github.com/edx/course-discovery/pull/389#discussion_r83942952"},"pull_request":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/389"}}},"pull_request":{"url":"https://api.github.com/repos/edx/course-discovery/pulls/389","id":89887149,"html_url":"https://github.com/edx/course-discovery/pull/389","diff_url":"https://github.com/edx/course-discovery/pull/389.diff","patch_url":"https://github.com/edx/course-discovery/pull/389.patch","issue_url":"https://api.github.com/repos/edx/course-discovery/issues/389","number":389,"state":"open","locked":false,"title":"Update Search Indexer to exclude unpublished programs","user":{"login":"mikedikan","id":1236705,"avatar_url":"https://avatars.githubusercontent.com/u/1236705?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedikan","html_url":"https://github.com/mikedikan","followers_url":"https://api.github.com/users/mikedikan/followers","following_url":"https://api.github.com/users/mikedikan/following{/other_user}","gists_url":"https://api.github.com/users/mikedikan/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedikan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedikan/subscriptions","organizations_url":"https://api.github.com/users/mikedikan/orgs","repos_url":"https://api.github.com/users/mikedikan/repos","events_url":"https://api.github.com/users/mikedikan/events{/privacy}","received_events_url":"https://api.github.com/users/mikedikan/received_events","type":"User","site_admin":false},"body":"Exclude when nested unpublished programs are under course runs on course run search endpoint.\r\n\r\nECOM-6147\r\n\r\n@schenedx & @clintonb for review","created_at":"2016-10-18T19:57:23Z","updated_at":"2016-10-18T20:28:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41df1ce1bb0ac0ee10537a7bbd08c039b33f4b1c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/course-discovery/pulls/389/commits","review_comments_url":"https://api.github.com/repos/edx/course-discovery/pulls/389/comments","review_comment_url":"https://api.github.com/repos/edx/course-discovery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/course-discovery/issues/389/comments","statuses_url":"https://api.github.com/repos/edx/course-discovery/statuses/118a82b7aeb4b6c42155e0b1625ac76cd90b4eae","head":{"label":"edx:mdikan/remove-unpublished-programs-course-search-endpoint","ref":"mdikan/remove-unpublished-programs-course-search-endpoint","sha":"118a82b7aeb4b6c42155e0b1625ac76cd90b4eae","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","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":45866355,"name":"course-discovery","full_name":"edx/course-discovery","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","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},"private":false,"html_url":"https://github.com/edx/course-discovery","description":"edX Course Catalog Service","fork":false,"url":"https://api.github.com/repos/edx/course-discovery","forks_url":"https://api.github.com/repos/edx/course-discovery/forks","keys_url":"https://api.github.com/repos/edx/course-discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/course-discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/course-discovery/teams","hooks_url":"https://api.github.com/repos/edx/course-discovery/hooks","issue_events_url":"https://api.github.com/repos/edx/course-discovery/issues/events{/number}","events_url":"https://api.github.com/repos/edx/course-discovery/events","assignees_url":"https://api.github.com/repos/edx/course-discovery/assignees{/user}","branches_url":"https://api.github.com/repos/edx/course-discovery/branches{/branch}","tags_url":"https://api.github.com/repos/edx/course-discovery/tags","blobs_url":"https://api.github.com/repos/edx/course-discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/course-discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/course-discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/course-discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/course-discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/course-discovery/languages","stargazers_url":"https://api.github.com/repos/edx/course-discovery/stargazers","contributors_url":"https://api.github.com/repos/edx/course-discovery/contributors","subscribers_url":"https://api.github.com/repos/edx/course-discovery/subscribers","subscription_url":"https://api.github.com/repos/edx/course-discovery/subscription","commits_url":"https://api.github.com/repos/edx/course-discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/course-discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/course-discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/course-discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/course-discovery/contents/{+path}","compare_url":"https://api.github.com/repos/edx/course-discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/course-discovery/merges","archive_url":"https://api.github.com/repos/edx/course-discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/course-discovery/downloads","issues_url":"https://api.github.com/repos/edx/course-discovery/issues{/number}","pulls_url":"https://api.github.com/repos/edx/course-discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/course-discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/course-discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/course-discovery/labels{/name}","releases_url":"https://api.github.com/repos/edx/course-discovery/releases{/id}","deployments_url":"https://api.github.com/repos/edx/course-discovery/deployments","created_at":"2015-11-09T20:57:54Z","updated_at":"2016-06-13T22:16:44Z","pushed_at":"2016-10-18T20:28:33Z","git_url":"git://github.com/edx/course-discovery.git","ssh_url":"git@github.com:edx/course-discovery.git","clone_url":"https://github.com/edx/course-discovery.git","svn_url":"https://github.com/edx/course-discovery","homepage":"","size":2131,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":10,"forks":5,"open_issues":10,"watchers":3,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"e634129d63186f01b980fd3ddf64bd7b01fb7d3f","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","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":45866355,"name":"course-discovery","full_name":"edx/course-discovery","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","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},"private":false,"html_url":"https://github.com/edx/course-discovery","description":"edX Course Catalog Service","fork":false,"url":"https://api.github.com/repos/edx/course-discovery","forks_url":"https://api.github.com/repos/edx/course-discovery/forks","keys_url":"https://api.github.com/repos/edx/course-discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/course-discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/course-discovery/teams","hooks_url":"https://api.github.com/repos/edx/course-discovery/hooks","issue_events_url":"https://api.github.com/repos/edx/course-discovery/issues/events{/number}","events_url":"https://api.github.com/repos/edx/course-discovery/events","assignees_url":"https://api.github.com/repos/edx/course-discovery/assignees{/user}","branches_url":"https://api.github.com/repos/edx/course-discovery/branches{/branch}","tags_url":"https://api.github.com/repos/edx/course-discovery/tags","blobs_url":"https://api.github.com/repos/edx/course-discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/course-discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/course-discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/course-discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/course-discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/course-discovery/languages","stargazers_url":"https://api.github.com/repos/edx/course-discovery/stargazers","contributors_url":"https://api.github.com/repos/edx/course-discovery/contributors","subscribers_url":"https://api.github.com/repos/edx/course-discovery/subscribers","subscription_url":"https://api.github.com/repos/edx/course-discovery/subscription","commits_url":"https://api.github.com/repos/edx/course-discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/course-discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/course-discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/course-discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/course-discovery/contents/{+path}","compare_url":"https://api.github.com/repos/edx/course-discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/course-discovery/merges","archive_url":"https://api.github.com/repos/edx/course-discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/course-discovery/downloads","issues_url":"https://api.github.com/repos/edx/course-discovery/issues{/number}","pulls_url":"https://api.github.com/repos/edx/course-discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/course-discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/course-discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/course-discovery/labels{/name}","releases_url":"https://api.github.com/repos/edx/course-discovery/releases{/id}","deployments_url":"https://api.github.com/repos/edx/course-discovery/deployments","created_at":"2015-11-09T20:57:54Z","updated_at":"2016-06-13T22:16:44Z","pushed_at":"2016-10-18T20:28:33Z","git_url":"git://github.com/edx/course-discovery.git","ssh_url":"git@github.com:edx/course-discovery.git","clone_url":"https://github.com/edx/course-discovery.git","svn_url":"https://github.com/edx/course-discovery","homepage":"","size":2131,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":10,"forks":5,"open_issues":10,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/389"},"html":{"href":"https://github.com/edx/course-discovery/pull/389"},"issue":{"href":"https://api.github.com/repos/edx/course-discovery/issues/389"},"comments":{"href":"https://api.github.com/repos/edx/course-discovery/issues/389/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/389/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/389/commits"},"statuses":{"href":"https://api.github.com/repos/edx/course-discovery/statuses/118a82b7aeb4b6c42155e0b1625ac76cd90b4eae"}}}}
{"actor":{"display_login":"clintonb"}}