{"action":"created","comment":{"url":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/comments/36606109","id":36606109,"diff_hunk":"@@ -1012,6 +1009,13 @@ def get(self, request, user_id, course_id):\n         if len(queryset):\n             current_grade = queryset[0].grade\n             proforma_grade = queryset[0].proforma_grade\n+            progress_summary = json.loads(queryset[0].progress_summary)\n+            grade_summary = json.loads(queryset[0].grade_summary)\n+            grading_policy = json.loads(queryset[0].grading_policy)\n+        else:","path":"lms/djangoapps/api_manager/users/views.py","position":26,"original_position":26,"commit_id":"710628335d11c47f1f80095e4ca9cf2536c9dde9","original_commit_id":"710628335d11c47f1f80095e4ca9cf2536c9dde9","user":{"login":"marjev","id":6833568,"avatar_url":"https://avatars.githubusercontent.com/u/6833568?v=3","gravatar_id":"","url":"https://api.github.com/users/marjev","html_url":"https://github.com/marjev","followers_url":"https://api.github.com/users/marjev/followers","following_url":"https://api.github.com/users/marjev/following{/other_user}","gists_url":"https://api.github.com/users/marjev/gists{/gist_id}","starred_url":"https://api.github.com/users/marjev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marjev/subscriptions","organizations_url":"https://api.github.com/users/marjev/orgs","repos_url":"https://api.github.com/users/marjev/repos","events_url":"https://api.github.com/users/marjev/events{/privacy}","received_events_url":"https://api.github.com/users/marjev/received_events","type":"User","site_admin":false},"body":"The reason why I added the else statement is that I saw we initialized grades to a value of zero before the if statement, so I guessed that summaries and grading_policy should be dealt with in the same fashion.\r\n\r\nMy initial thought was to initialize the three as an `{}` but didn't know how apros would respond to that, since it expected summaries and grading policy to have certain key/value pairs (I believe it would result in KeyError exception or something similar). So, because of that, I've decided to add the else statement, thus providing proper initialization in case if condition returns false (e.g. database table has no records for any reason).\r\n\r\nThis is just a safety precaution, but if you think we can do without it or have a better alternative for this, please let me know.","created_at":"2015-08-10T07:09:58Z","updated_at":"2015-08-10T07:09:58Z","html_url":"https://github.com/edx-solutions/edx-platform/pull/473#discussion_r36606109","pull_request_url":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/473","_links":{"self":{"href":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/comments/36606109"},"html":{"href":"https://github.com/edx-solutions/edx-platform/pull/473#discussion_r36606109"},"pull_request":{"href":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/473"}}},"pull_request":{"url":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/473","id":41422453,"html_url":"https://github.com/edx-solutions/edx-platform/pull/473","diff_url":"https://github.com/edx-solutions/edx-platform/pull/473.diff","patch_url":"https://github.com/edx-solutions/edx-platform/pull/473.patch","issue_url":"https://api.github.com/repos/edx-solutions/edx-platform/issues/473","number":473,"state":"open","locked":false,"title":"(WIP)(YONK-8) Performance Improvement - UsersCoursesGradesDetail","user":{"login":"marjev","id":6833568,"avatar_url":"https://avatars.githubusercontent.com/u/6833568?v=3","gravatar_id":"","url":"https://api.github.com/users/marjev","html_url":"https://github.com/marjev","followers_url":"https://api.github.com/users/marjev/followers","following_url":"https://api.github.com/users/marjev/following{/other_user}","gists_url":"https://api.github.com/users/marjev/gists{/gist_id}","starred_url":"https://api.github.com/users/marjev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marjev/subscriptions","organizations_url":"https://api.github.com/users/marjev/orgs","repos_url":"https://api.github.com/users/marjev/repos","events_url":"https://api.github.com/users/marjev/events{/privacy}","received_events_url":"https://api.github.com/users/marjev/received_events","type":"User","site_admin":false},"body":"@mattdrayer Here's a PR marked as WIP regarding YONK-8. I followed the guidelines you left in the ticket description.\r\n\r\nStory in JIRA: https://openedx.atlassian.net/browse/YONK-8","created_at":"2015-08-02T18:49:57Z","updated_at":"2015-08-10T07:09:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9dab63fb7293ffdc760082a7661e4d358d38378f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/473/commits","review_comments_url":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/473/comments","review_comment_url":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx-solutions/edx-platform/issues/473/comments","statuses_url":"https://api.github.com/repos/edx-solutions/edx-platform/statuses/710628335d11c47f1f80095e4ca9cf2536c9dde9","head":{"label":"edx-solutions:mjevtic/YONK-8","ref":"mjevtic/YONK-8","sha":"710628335d11c47f1f80095e4ca9cf2536c9dde9","user":{"login":"edx-solutions","id":6585054,"avatar_url":"https://avatars.githubusercontent.com/u/6585054?v=3","gravatar_id":"","url":"https://api.github.com/users/edx-solutions","html_url":"https://github.com/edx-solutions","followers_url":"https://api.github.com/users/edx-solutions/followers","following_url":"https://api.github.com/users/edx-solutions/following{/other_user}","gists_url":"https://api.github.com/users/edx-solutions/gists{/gist_id}","starred_url":"https://api.github.com/users/edx-solutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx-solutions/subscriptions","organizations_url":"https://api.github.com/users/edx-solutions/orgs","repos_url":"https://api.github.com/users/edx-solutions/repos","events_url":"https://api.github.com/users/edx-solutions/events{/privacy}","received_events_url":"https://api.github.com/users/edx-solutions/received_events","type":"Organization","site_admin":false},"repo":{"id":16513414,"name":"edx-platform","full_name":"edx-solutions/edx-platform","owner":{"login":"edx-solutions","id":6585054,"avatar_url":"https://avatars.githubusercontent.com/u/6585054?v=3","gravatar_id":"","url":"https://api.github.com/users/edx-solutions","html_url":"https://github.com/edx-solutions","followers_url":"https://api.github.com/users/edx-solutions/followers","following_url":"https://api.github.com/users/edx-solutions/following{/other_user}","gists_url":"https://api.github.com/users/edx-solutions/gists{/gist_id}","starred_url":"https://api.github.com/users/edx-solutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx-solutions/subscriptions","organizations_url":"https://api.github.com/users/edx-solutions/orgs","repos_url":"https://api.github.com/users/edx-solutions/repos","events_url":"https://api.github.com/users/edx-solutions/events{/privacy}","received_events_url":"https://api.github.com/users/edx-solutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx-solutions/edx-platform","description":"the edX learning management system (LMS) and course authoring tool, Studio","fork":true,"url":"https://api.github.com/repos/edx-solutions/edx-platform","forks_url":"https://api.github.com/repos/edx-solutions/edx-platform/forks","keys_url":"https://api.github.com/repos/edx-solutions/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx-solutions/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx-solutions/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx-solutions/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx-solutions/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx-solutions/edx-platform/events","assignees_url":"https://api.github.com/repos/edx-solutions/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx-solutions/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx-solutions/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx-solutions/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx-solutions/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx-solutions/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx-solutions/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx-solutions/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx-solutions/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx-solutions/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx-solutions/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx-solutions/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx-solutions/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx-solutions/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx-solutions/edx-platform/merges","archive_url":"https://api.github.com/repos/edx-solutions/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx-solutions/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx-solutions/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx-solutions/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx-solutions/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx-solutions/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx-solutions/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx-solutions/edx-platform/releases{/id}","created_at":"2014-02-04T14:02:57Z","updated_at":"2015-05-19T21:00:36Z","pushed_at":"2015-08-07T22:44:46Z","git_url":"git://github.com/edx-solutions/edx-platform.git","ssh_url":"git@github.com:edx-solutions/edx-platform.git","clone_url":"https://github.com/edx-solutions/edx-platform.git","svn_url":"https://github.com/edx-solutions/edx-platform","homepage":"http://code.edx.org/","size":500367,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":5,"default_branch":"master"}},"base":{"label":"edx-solutions:master","ref":"master","sha":"42804d4f9d09871a7f5ea4e86b4f20428218287b","user":{"login":"edx-solutions","id":6585054,"avatar_url":"https://avatars.githubusercontent.com/u/6585054?v=3","gravatar_id":"","url":"https://api.github.com/users/edx-solutions","html_url":"https://github.com/edx-solutions","followers_url":"https://api.github.com/users/edx-solutions/followers","following_url":"https://api.github.com/users/edx-solutions/following{/other_user}","gists_url":"https://api.github.com/users/edx-solutions/gists{/gist_id}","starred_url":"https://api.github.com/users/edx-solutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx-solutions/subscriptions","organizations_url":"https://api.github.com/users/edx-solutions/orgs","repos_url":"https://api.github.com/users/edx-solutions/repos","events_url":"https://api.github.com/users/edx-solutions/events{/privacy}","received_events_url":"https://api.github.com/users/edx-solutions/received_events","type":"Organization","site_admin":false},"repo":{"id":16513414,"name":"edx-platform","full_name":"edx-solutions/edx-platform","owner":{"login":"edx-solutions","id":6585054,"avatar_url":"https://avatars.githubusercontent.com/u/6585054?v=3","gravatar_id":"","url":"https://api.github.com/users/edx-solutions","html_url":"https://github.com/edx-solutions","followers_url":"https://api.github.com/users/edx-solutions/followers","following_url":"https://api.github.com/users/edx-solutions/following{/other_user}","gists_url":"https://api.github.com/users/edx-solutions/gists{/gist_id}","starred_url":"https://api.github.com/users/edx-solutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx-solutions/subscriptions","organizations_url":"https://api.github.com/users/edx-solutions/orgs","repos_url":"https://api.github.com/users/edx-solutions/repos","events_url":"https://api.github.com/users/edx-solutions/events{/privacy}","received_events_url":"https://api.github.com/users/edx-solutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx-solutions/edx-platform","description":"the edX learning management system (LMS) and course authoring tool, Studio","fork":true,"url":"https://api.github.com/repos/edx-solutions/edx-platform","forks_url":"https://api.github.com/repos/edx-solutions/edx-platform/forks","keys_url":"https://api.github.com/repos/edx-solutions/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx-solutions/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx-solutions/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx-solutions/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx-solutions/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx-solutions/edx-platform/events","assignees_url":"https://api.github.com/repos/edx-solutions/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx-solutions/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx-solutions/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx-solutions/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx-solutions/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx-solutions/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx-solutions/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx-solutions/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx-solutions/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx-solutions/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx-solutions/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx-solutions/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx-solutions/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx-solutions/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx-solutions/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx-solutions/edx-platform/merges","archive_url":"https://api.github.com/repos/edx-solutions/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx-solutions/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx-solutions/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx-solutions/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx-solutions/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx-solutions/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx-solutions/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx-solutions/edx-platform/releases{/id}","created_at":"2014-02-04T14:02:57Z","updated_at":"2015-05-19T21:00:36Z","pushed_at":"2015-08-07T22:44:46Z","git_url":"git://github.com/edx-solutions/edx-platform.git","ssh_url":"git@github.com:edx-solutions/edx-platform.git","clone_url":"https://github.com/edx-solutions/edx-platform.git","svn_url":"https://github.com/edx-solutions/edx-platform","homepage":"http://code.edx.org/","size":500367,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/473"},"html":{"href":"https://github.com/edx-solutions/edx-platform/pull/473"},"issue":{"href":"https://api.github.com/repos/edx-solutions/edx-platform/issues/473"},"comments":{"href":"https://api.github.com/repos/edx-solutions/edx-platform/issues/473/comments"},"review_comments":{"href":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/473/comments"},"review_comment":{"href":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx-solutions/edx-platform/pulls/473/commits"},"statuses":{"href":"https://api.github.com/repos/edx-solutions/edx-platform/statuses/710628335d11c47f1f80095e4ca9cf2536c9dde9"}}}}