{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/46261216","id":46261216,"diff_hunk":"@@ -304,20 +304,19 @@ def certificate_info_for_user(user, course_id, grade, user_is_whitelisted=None):\n             user=user, course_id=course_id, whitelist=True\n         ).exists()\n \n+    user_is_eligible = 'N'\n+    certificate_is_delivered = 'N'\n+    certificate_type = 'N/A'\n     eligible_for_certificate = (user_is_whitelisted or grade is not None) and user.profile.allow_certificate\n \n     if eligible_for_certificate:\n         user_is_eligible = 'Y'\n \n-        certificate_status = certificate_status_for_student(user, course_id)\n-        certificate_generated = certificate_status['status'] == CertificateStatuses.downloadable\n-        certificate_is_delivered = 'Y' if certificate_generated else 'N'\n-\n-        certificate_type = certificate_status['mode'] if certificate_generated else 'N/A'\n-    else:\n-        user_is_eligible = 'N'\n-        certificate_is_delivered = 'N'\n-        certificate_type = 'N/A'\n+    certificate_status = certificate_status_for_student(user, course_id)\n+    certificate_generated = certificate_status['status'] == CertificateStatuses.downloadable\n+    if certificate_generated:\n+        certificate_is_delivered = 'Y'\n+        certificate_type = certificate_status['mode']\n \n     return [user_is_eligible, certificate_is_delivered, certificate_type]","path":"lms/djangoapps/certificates/models.py","position":27,"original_position":27,"commit_id":"b6f7f3909b6380bd27b0b232d5afc6fce598ff37","original_commit_id":"b6f7f3909b6380bd27b0b232d5afc6fce598ff37","user":{"login":"afzaledx","id":9654006,"avatar_url":"https://avatars.githubusercontent.com/u/9654006?v=3","gravatar_id":"","url":"https://api.github.com/users/afzaledx","html_url":"https://github.com/afzaledx","followers_url":"https://api.github.com/users/afzaledx/followers","following_url":"https://api.github.com/users/afzaledx/following{/other_user}","gists_url":"https://api.github.com/users/afzaledx/gists{/gist_id}","starred_url":"https://api.github.com/users/afzaledx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afzaledx/subscriptions","organizations_url":"https://api.github.com/users/afzaledx/orgs","repos_url":"https://api.github.com/users/afzaledx/repos","events_url":"https://api.github.com/users/afzaledx/events{/privacy}","received_events_url":"https://api.github.com/users/afzaledx/received_events","type":"User","site_admin":false},"body":"return [eligible_for_certificate, certificate_is_delivered, certificate_type]","created_at":"2015-12-01T10:21:00Z","updated_at":"2015-12-01T10:21:00Z","html_url":"https://github.com/edx/edx-platform/pull/10759#discussion_r46261216","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/10759","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/46261216"},"html":{"href":"https://github.com/edx/edx-platform/pull/10759#discussion_r46261216"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10759"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/10759","id":52117690,"html_url":"https://github.com/edx/edx-platform/pull/10759","diff_url":"https://github.com/edx/edx-platform/pull/10759.diff","patch_url":"https://github.com/edx/edx-platform/pull/10759.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/10759","number":10759,"state":"open","locked":false,"title":"SOL-1439: removed certificates delivered dependency on certificate eligibility","user":{"login":"ziafazal","id":434995,"avatar_url":"https://avatars.githubusercontent.com/u/434995?v=3","gravatar_id":"","url":"https://api.github.com/users/ziafazal","html_url":"https://github.com/ziafazal","followers_url":"https://api.github.com/users/ziafazal/followers","following_url":"https://api.github.com/users/ziafazal/following{/other_user}","gists_url":"https://api.github.com/users/ziafazal/gists{/gist_id}","starred_url":"https://api.github.com/users/ziafazal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziafazal/subscriptions","organizations_url":"https://api.github.com/users/ziafazal/orgs","repos_url":"https://api.github.com/users/ziafazal/repos","events_url":"https://api.github.com/users/ziafazal/events{/privacy}","received_events_url":"https://api.github.com/users/ziafazal/received_events","type":"User","site_admin":false},"body":"This PR would remove Student's certificate delivery dependency on Student's eligibility to earn certificate. \r\nSOL-1439 reports a scenario when student's eligibility to earn certificate changed over a time period.\r\n@asadiqbal08 please review it.\r\n@mattdrayer FYI.","created_at":"2015-11-30T12:25:11Z","updated_at":"2015-12-01T10:21:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d72c04ad12f76df33e4e04f9d0c58375378d1030","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/10759/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/10759/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/10759/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/b6f7f3909b6380bd27b0b232d5afc6fce598ff37","head":{"label":"edx:ziafazal/SOL-1439","ref":"ziafazal/SOL-1439","sha":"b6f7f3909b6380bd27b0b232d5afc6fce598ff37","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-01T10:16:58Z","pushed_at":"2015-12-01T10:17:04Z","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":601453,"stargazers_count":2273,"watchers_count":2273,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1387,"mirror_url":null,"open_issues_count":157,"forks":1387,"open_issues":157,"watchers":2273,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"a0db0d8297e949d48e3cf4410d105e847cc7a3c1","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-01T10:16:58Z","pushed_at":"2015-12-01T10:17:04Z","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":601453,"stargazers_count":2273,"watchers_count":2273,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1387,"mirror_url":null,"open_issues_count":157,"forks":1387,"open_issues":157,"watchers":2273,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10759"},"html":{"href":"https://github.com/edx/edx-platform/pull/10759"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10759"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10759/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10759/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/10759/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/b6f7f3909b6380bd27b0b232d5afc6fce598ff37"}}}}