GitHub PullRequestReviewCommentEvent at 2014-12-04 19:35:08
Repository: edx-platform
Actor: cpennington
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/21329705","id":21329705,"diff_hunk":"@@ -288,23 +241,28 @@ def dump_student_extensions(course, student):\n     data = []\n     header = [_(\"Unit\"), _(\"Extended Due Date\")]\n     units = get_units_with_due_date(course)\n-    units = dict([(u.location, u) for u in units])\n-    query = StudentModule.objects.filter(\n+    units = dict([(str(u.location), u) for u in units])\n+    query = StudentFieldOverride.objects.filter(\n         course_id=course.id,\n-        student_id=student.id)\n-    for module in query:\n-        state = json.loads(module.state)\n-        # temporary hack: module_state_key is missing the run but units are not. fix module_state_key\n-        module_loc = module.module_state_key.map_into_course(module.course_id)\n-        if module_loc not in units:\n-            continue\n-        extended_due = state.get(\"extended_due\")\n-        if not extended_due:\n+        student=student,\n+        field='due')\n+    for override in query:\n+        # Note that the reason we convert to a string here is because locators\n+        # don't currently round trip properly(?) with\n+        # xmodule_django.models.LocationKeyField, which uses str(locator) to\n+        # save the locator in the location column.  Unfortunately str(locator)\n+        # loses the course run, included in the locations of units above, and\n+        # also in block.location when saving the override in the first place.\n+        # Unfortunately, block_new.location != block_saved.location.\n+        # Converting to string is kind of a hacky work around that works for\n+        # now.","path":"lms/djangoapps/instructor/views/tools.py","position":160,"original_position":160,"commit_id":"a238cdf32c82ae421b0340132a2e631b9a339af2","original_commit_id":"a238cdf32c82ae421b0340132a2e631b9a339af2","user":{"login":"cpennington","id":30236,"avatar_url":"https://avatars.githubusercontent.com/u/30236?v=3","gravatar_id":"","url":"https://api.github.com/users/cpennington","html_url":"https://github.com/cpennington","followers_url":"https://api.github.com/users/cpennington/followers","following_url":"https://api.github.com/users/cpennington/following{/other_user}","gists_url":"https://api.github.com/users/cpennington/gists{/gist_id}","starred_url":"https://api.github.com/users/cpennington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpennington/subscriptions","organizations_url":"https://api.github.com/users/cpennington/orgs","repos_url":"https://api.github.com/users/cpennington/repos","events_url":"https://api.github.com/users/cpennington/events{/privacy}","received_events_url":"https://api.github.com/users/cpennington/received_events","type":"User","site_admin":false},"body":"Locators from xml and old-mongo backed courses do in fact lose the course run (that's why we have the new style of locators for split mongo). In general, the way we approach this in the LMS is to make sure we always have a courseid in hand when we try and hydrate the Location out of the database (and, notably, we store the course_id in the database in courseware_studentmodule). Can you take a similar tack here?","created_at":"2014-12-04T19:35:08Z","updated_at":"2014-12-04T19:35:08Z","html_url":"https://github.com/edx/edx-platform/pull/5802#discussion_r21329705","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/5802","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/21329705"},"html":{"href":"https://github.com/edx/edx-platform/pull/5802#discussion_r21329705"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/5802"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/5802","id":23633462,"html_url":"https://github.com/edx/edx-platform/pull/5802","diff_url":"https://github.com/edx/edx-platform/pull/5802.diff","patch_url":"https://github.com/edx/edx-platform/pull/5802.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/5802","number":5802,"state":"open","locked":false,"title":"Field Overrides","user":{"login":"chrisrossi","id":148267,"avatar_url":"https://avatars.githubusercontent.com/u/148267?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisrossi","html_url":"https://github.com/chrisrossi","followers_url":"https://api.github.com/users/chrisrossi/followers","following_url":"https://api.github.com/users/chrisrossi/following{/other_user}","gists_url":"https://api.github.com/users/chrisrossi/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisrossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisrossi/subscriptions","organizations_url":"https://api.github.com/users/chrisrossi/orgs","repos_url":"https://api.github.com/users/chrisrossi/repos","events_url":"https://api.github.com/users/chrisrossi/events{/privacy}","received_events_url":"https://api.github.com/users/chrisrossi/received_events","type":"User","site_admin":false},"body":"Architecture for arbitrary field overrides, field overrides for\r\nindividual students, and a reimplementation of the individual due date\r\nfeature.\r\n\r\nThis work introduces an architecture, used with the 'authored_data'\r\nportion of LmsFieldData, which allows arbitrary field overrides to be\r\nmade for fields that are part of the course content or settings (Mongo\r\ndata).  The basic architecture is extensible by means of writing and\r\nconfiguring arbitrary field override providers.\r\n\r\nOne concrete implementation of a field override provider is provided\r\nwhich allows for overrides to be for individual students.  This provider\r\nis then used as a basis for reimplementing the individual due date\r\nextensions feature as a proof of concept for the design.\r\n\r\nOne can imagine writing override providers that provide overrides based\r\non a student's membership in a cohort or other similar idea.  This work\r\nis being done, in fact, to pave the way for the Personal Online Courses\r\nfeature being developed by MIT, which will use an override provider very\r\nmuch long those lines.","created_at":"2014-10-30T19:53:35Z","updated_at":"2014-12-04T19:35:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce920649952a429fe7e4530e628518ba98c407a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/5802/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/5802/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/5802/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/a238cdf32c82ae421b0340132a2e631b9a339af2","head":{"label":"jazkarta:feature-settings-scope-overrides","ref":"feature-settings-scope-overrides","sha":"a238cdf32c82ae421b0340132a2e631b9a339af2","user":{"login":"jazkarta","id":974974,"avatar_url":"https://avatars.githubusercontent.com/u/974974?v=3","gravatar_id":"","url":"https://api.github.com/users/jazkarta","html_url":"https://github.com/jazkarta","followers_url":"https://api.github.com/users/jazkarta/followers","following_url":"https://api.github.com/users/jazkarta/following{/other_user}","gists_url":"https://api.github.com/users/jazkarta/gists{/gist_id}","starred_url":"https://api.github.com/users/jazkarta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jazkarta/subscriptions","organizations_url":"https://api.github.com/users/jazkarta/orgs","repos_url":"https://api.github.com/users/jazkarta/repos","events_url":"https://api.github.com/users/jazkarta/events{/privacy}","received_events_url":"https://api.github.com/users/jazkarta/received_events","type":"Organization","site_admin":false},"repo":{"id":13279839,"name":"edx-platform","full_name":"jazkarta/edx-platform","owner":{"login":"jazkarta","id":974974,"avatar_url":"https://avatars.githubusercontent.com/u/974974?v=3","gravatar_id":"","url":"https://api.github.com/users/jazkarta","html_url":"https://github.com/jazkarta","followers_url":"https://api.github.com/users/jazkarta/followers","following_url":"https://api.github.com/users/jazkarta/following{/other_user}","gists_url":"https://api.github.com/users/jazkarta/gists{/gist_id}","starred_url":"https://api.github.com/users/jazkarta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jazkarta/subscriptions","organizations_url":"https://api.github.com/users/jazkarta/orgs","repos_url":"https://api.github.com/users/jazkarta/repos","events_url":"https://api.github.com/users/jazkarta/events{/privacy}","received_events_url":"https://api.github.com/users/jazkarta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jazkarta/edx-platform","description":"the edX learning management system (LMS) and course authoring tool, Studio","fork":true,"url":"https://api.github.com/repos/jazkarta/edx-platform","forks_url":"https://api.github.com/repos/jazkarta/edx-platform/forks","keys_url":"https://api.github.com/repos/jazkarta/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jazkarta/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jazkarta/edx-platform/teams","hooks_url":"https://api.github.com/repos/jazkarta/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/jazkarta/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/jazkarta/edx-platform/events","assignees_url":"https://api.github.com/repos/jazkarta/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/jazkarta/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/jazkarta/edx-platform/tags","blobs_url":"https://api.github.com/repos/jazkarta/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jazkarta/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jazkarta/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/jazkarta/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jazkarta/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/jazkarta/edx-platform/languages","stargazers_url":"https://api.github.com/repos/jazkarta/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/jazkarta/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/jazkarta/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/jazkarta/edx-platform/subscription","commits_url":"https://api.github.com/repos/jazkarta/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/jazkarta/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/jazkarta/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/jazkarta/edx-platform/issues/comments/{number}","contents_url":"https://api.github.com/repos/jazkarta/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/jazkarta/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jazkarta/edx-platform/merges","archive_url":"https://api.github.com/repos/jazkarta/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jazkarta/edx-platform/downloads","issues_url":"https://api.github.com/repos/jazkarta/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/jazkarta/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/jazkarta/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/jazkarta/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jazkarta/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/jazkarta/edx-platform/releases{/id}","created_at":"2013-10-02T18:52:14Z","updated_at":"2014-12-01T14:12:35Z","pushed_at":"2014-12-04T16:47:32Z","git_url":"git://github.com/jazkarta/edx-platform.git","ssh_url":"git@github.com:jazkarta/edx-platform.git","clone_url":"https://github.com/jazkarta/edx-platform.git","svn_url":"https://github.com/jazkarta/edx-platform","homepage":"http://code.edx.org/","size":381754,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"7d6dd565dbedf654bce2888e5f60c6b7cb3e0409","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":"Open edX, the edX platform that powers http://edx.org","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":"2014-12-04T19:08:57Z","pushed_at":"2014-12-04T19:24:12Z","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://openedx.org/","size":1518316,"stargazers_count":1584,"watchers_count":1584,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":922,"mirror_url":null,"open_issues_count":128,"forks":922,"open_issues":128,"watchers":1584,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/5802"},"html":{"href":"https://github.com/edx/edx-platform/pull/5802"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/5802"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/5802/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/5802/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/5802/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/a238cdf32c82ae421b0340132a2e631b9a339af2"}}}}