GitHub PullRequestReviewCommentEvent at 2014-02-05 17:12:48
Repository: edx-platform
Actor: singingwolfboy
Payload: {"comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/9468522","id":9468522,"diff_hunk":"@@ -157,60 +157,27 @@ def convert_to_draft(self, source_location):\n \n         return self._load_items([original])[0]\n \n-    def update_item(self, location, data, allow_not_found=False):\n+    def update_item(self, xblock, user, allow_not_found=False):\n         \"\"\"\n-        Set the data in the item specified by the location to\n-        data\n+        Save the current values to persisted version of the xblock\n \n         location: Something that can be passed to Location\n         data: A nested dictionary of problem data\n         \"\"\"\n-        draft_loc = as_draft(location)\n+        draft_loc = as_draft(xblock.location)\n         try:\n-            draft_item = self.get_item(location)\n-            if not getattr(draft_item, 'is_draft', False):\n-                self.convert_to_draft(location)\n+            if not self.has_item(None, draft_loc):\n+                self.convert_to_draft(xblock.location)\n         except ItemNotFoundError, e:\n             if not allow_not_found:\n                 raise e","path":"common/lib/xmodule/xmodule/modulestore/mongo/draft.py","position":56,"original_position":56,"commit_id":"b8ea7f3c432f6a87eafb1b6d8be9b6962316934c","original_commit_id":"b8ea7f3c432f6a87eafb1b6d8be9b6962316934c","user":{"login":"singingwolfboy","id":132355,"avatar_url":"https://gravatar.com/avatar/42c77de97965d620ba0b6ae624c3ba7b?d=https%3A%2F%2Fidenticons.github.com%2Fd8b65bc1ad622719a92542b55b34bc7a.png&r=x","gravatar_id":"42c77de97965d620ba0b6ae624c3ba7b","url":"https://api.github.com/users/singingwolfboy","html_url":"https://github.com/singingwolfboy","followers_url":"https://api.github.com/users/singingwolfboy/followers","following_url":"https://api.github.com/users/singingwolfboy/following{/other_user}","gists_url":"https://api.github.com/users/singingwolfboy/gists{/gist_id}","starred_url":"https://api.github.com/users/singingwolfboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singingwolfboy/subscriptions","organizations_url":"https://api.github.com/users/singingwolfboy/orgs","repos_url":"https://api.github.com/users/singingwolfboy/repos","events_url":"https://api.github.com/users/singingwolfboy/events{/privacy}","received_events_url":"https://api.github.com/users/singingwolfboy/received_events","type":"User","site_admin":false},"body":"I know you didn't actually modify this line, but it should be just `raise` instead of `raise e`. Can you fix it?","created_at":"2014-02-05T17:12:48Z","updated_at":"2014-02-05T17:12:48Z","html_url":"https://github.com/edx/edx-platform/pull/2356#discussion_r9468522","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/2356","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/9468522"},"html":{"href":"https://github.com/edx/edx-platform/pull/2356#discussion_r9468522"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/2356"}}}}