{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/47185475","id":47185475,"diff_hunk":"@@ -222,3 +223,47 @@ def may_certify_for_course(certificates_display_behavior, certificates_show_befo\n         or certificates_show_before_end\n     )\n     return show_early or has_ended\n+\n+\n+def sorting_score(start, advertised_start, announcement):\n+    \"\"\"\n+    Returns a tuple that can be used to sort the courses according\n+    the how \"new\" they are. The \"newness\" score is computed using a\n+    heuristic that takes into account the announcement and\n+    (advertised) start dates of the course if available.\n+\n+    The lower the number the \"newer\" the course.\n+    \"\"\"\n+    # Make courses that have an announcement date shave a lower","path":"common/lib/xmodule/xmodule/course_metadata_utils.py","position":28,"original_position":28,"commit_id":"1ed0e9d5ea8b51b5f4b5e6b39b230ee1e857bb26","original_commit_id":"1ed0e9d5ea8b51b5f4b5e6b39b230ee1e857bb26","user":{"login":"nasthagiri","id":6772826,"avatar_url":"https://avatars.githubusercontent.com/u/6772826?v=3","gravatar_id":"","url":"https://api.github.com/users/nasthagiri","html_url":"https://github.com/nasthagiri","followers_url":"https://api.github.com/users/nasthagiri/followers","following_url":"https://api.github.com/users/nasthagiri/following{/other_user}","gists_url":"https://api.github.com/users/nasthagiri/gists{/gist_id}","starred_url":"https://api.github.com/users/nasthagiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasthagiri/subscriptions","organizations_url":"https://api.github.com/users/nasthagiri/orgs","repos_url":"https://api.github.com/users/nasthagiri/repos","events_url":"https://api.github.com/users/nasthagiri/events{/privacy}","received_events_url":"https://api.github.com/users/nasthagiri/received_events","type":"User","site_admin":false},"body":"fixed.","created_at":"2015-12-10T03:29:32Z","updated_at":"2015-12-10T03:29:32Z","html_url":"https://github.com/edx/edx-platform/pull/10841#discussion_r47185475","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/10841","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/47185475"},"html":{"href":"https://github.com/edx/edx-platform/pull/10841#discussion_r47185475"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10841"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/10841","id":52742115,"html_url":"https://github.com/edx/edx-platform/pull/10841","diff_url":"https://github.com/edx/edx-platform/pull/10841.diff","patch_url":"https://github.com/edx/edx-platform/pull/10841.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/10841","number":10841,"state":"open","locked":false,"title":"Optimize Course Catalog using CourseOverview","user":{"login":"nasthagiri","id":6772826,"avatar_url":"https://avatars.githubusercontent.com/u/6772826?v=3","gravatar_id":"","url":"https://api.github.com/users/nasthagiri","html_url":"https://github.com/nasthagiri","followers_url":"https://api.github.com/users/nasthagiri/followers","following_url":"https://api.github.com/users/nasthagiri/following{/other_user}","gists_url":"https://api.github.com/users/nasthagiri/gists{/gist_id}","starred_url":"https://api.github.com/users/nasthagiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasthagiri/subscriptions","organizations_url":"https://api.github.com/users/nasthagiri/orgs","repos_url":"https://api.github.com/users/nasthagiri/repos","events_url":"https://api.github.com/users/nasthagiri/events{/privacy}","received_events_url":"https://api.github.com/users/nasthagiri/received_events","type":"User","site_admin":false},"body":"This PR improves the performance of the Course Catalog API and the Course Catalog view for open edX instances by updating their code to retrieve information about the courses from CourseOverview data (in SQL) rather than through instantiated course modules from the modulestore (in MongoDB).\r\n\r\nThe following changes were made as part of this effort:\r\n* Added the following fields to `CourseOverview`: \r\n  * announcement\r\n  * catalog_visibility\r\n  * course_video_url\r\n  * effort\r\n  * short_description\r\n* Updated the Course index view to use CourseOverview.\r\n* Updated the Course Catalog and Course Detail APIs to use CourseOverview.\r\n  * Fixed the Course Detail API to check the correct permission.\r\n* Required the existence of CourseOverview models for each course in the system\r\n  * Introduced a `CourseOverviewGeneratedHistory` model to keep track of when the `CourseOverview` table is seeded with all courses in the system.\r\n  * Can be bootstrapped by calling the [generate_course_overview](https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/content/course_overviews/management/commands/generate_course_overview.py) management command.\r\n  * But also now lazily computed, when needed.\r\n* Removed support for the outdated `ispublic` field on the Course Module, including its corresponding `ACCESS_REQUIRE_STAFF_FOR_COURSE` feature flag.\r\n* Removed unused function [get_course_university_about_section](https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/courses.py#L132).\r\n* Removed support for 'title', 'university', and 'number' from [get_course_about_section](https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/courses.py#L142) since they are no longer stored as course about HTML modules, and should instead be accessed directly from the Course Module.\r\n\r\n*Reviewers:* @ormsbee, @robrap \r\n*FYI:* @cahrens, @rlucioni ","created_at":"2015-12-05T01:25:33Z","updated_at":"2015-12-10T03:29:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"105d6dc908d1162333001a5a4d3e2c52d3b1beaa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/10841/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/10841/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/10841/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/1ed0e9d5ea8b51b5f4b5e6b39b230ee1e857bb26","head":{"label":"edx:mobile/optimize-course-api","ref":"mobile/optimize-course-api","sha":"1ed0e9d5ea8b51b5f4b5e6b39b230ee1e857bb26","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":10391073,"name":"edx-platform","full_name":"edx/edx-platform","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/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-12-09T16:41:54Z","pushed_at":"2015-12-10T03:20:26Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":630239,"stargazers_count":2290,"watchers_count":2290,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1395,"mirror_url":null,"open_issues_count":144,"forks":1395,"open_issues":144,"watchers":2290,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"a974cec3bee1cc22bbef30314210512dc48cbd0b","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":10391073,"name":"edx-platform","full_name":"edx/edx-platform","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/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-12-09T16:41:54Z","pushed_at":"2015-12-10T03:20:26Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":630239,"stargazers_count":2290,"watchers_count":2290,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1395,"mirror_url":null,"open_issues_count":144,"forks":1395,"open_issues":144,"watchers":2290,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10841"},"html":{"href":"https://github.com/edx/edx-platform/pull/10841"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10841"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10841/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10841/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10841/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/1ed0e9d5ea8b51b5f4b5e6b39b230ee1e857bb26"}}}}