GitHub PullRequestReviewCommentEvent at 2014-02-24 18:30:14
Repository: edx-platform
Actor: auraz
Payload: {"comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/10002818","id":10002818,"diff_hunk":"@@ -116,27 +116,16 @@ def upload_transcripts(request):\n     # Allow upload only if any video link is presented\n     if video_list:\n         sub_attr = source_subs_name\n-\n         try:  # Generate and save for 1.0 speed, will create subs_sub_attr.srt.sjson subtitles file in storage.\n             generate_subs_from_source({1: sub_attr}, source_subs_ext, source_subs_filedata, item)\n         except TranscriptsGenerationException as e:\n             return error_response(response, e.message)\n-        statuses = {}\n         for video_dict in video_list:\n             video_name = video_dict['video']\n-            # We are creating transcripts for every video source,\n-            # for the case that in future, some of video sources can be deleted.\n-            statuses[video_name] = copy_or_rename_transcript(video_name, sub_attr, item, user=request.user)\n-            try:\n-                # updates item.sub with `video_name` if it is successful.\n-                copy_or_rename_transcript(video_name, sub_attr, item, user=request.user)\n-                selected_name = video_name  # name to write to item.sub field, chosen at random.\n-            except NotFoundError:","path":"cms/djangoapps/contentstore/views/transcripts_ajax.py","position":19,"original_position":19,"commit_id":"47440c1276c433f3800730799ef0f727e0a140ee","original_commit_id":"47440c1276c433f3800730799ef0f727e0a140ee","user":{"login":"auraz","id":67241,"avatar_url":"https://gravatar.com/avatar/9acee8355c23cc3cd1c89f32ce277099?d=https%3A%2F%2Fidenticons.github.com%2Fcb14e5b2e967ad428637b213b3a0207d.png&r=x","gravatar_id":"9acee8355c23cc3cd1c89f32ce277099","url":"https://api.github.com/users/auraz","html_url":"https://github.com/auraz","followers_url":"https://api.github.com/users/auraz/followers","following_url":"https://api.github.com/users/auraz/following{/other_user}","gists_url":"https://api.github.com/users/auraz/gists{/gist_id}","starred_url":"https://api.github.com/users/auraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auraz/subscriptions","organizations_url":"https://api.github.com/users/auraz/orgs","repos_url":"https://api.github.com/users/auraz/repos","events_url":"https://api.github.com/users/auraz/events{/privacy}","received_events_url":"https://api.github.com/users/auraz/received_events","type":"User","site_admin":false},"body":"In line 120, in generate_subs_from_source, SJON files will be generated for sub_attr subs_id (otherwise exit in 122). So copy_or_rename_transcript will be able to do copying. Previously, we caught exception in copy_or_rename_transcript if SRT file sub_attr does not exist. But we sure, that it is created in line 120. Also, removed code in line 129 worked w/o exception, so it is one more confirmation that try-except is not needed. ","created_at":"2014-02-24T18:30:14Z","updated_at":"2014-02-24T18:30:14Z","html_url":"https://github.com/edx/edx-platform/pull/2622#discussion_r10002818","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/2622","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/10002818"},"html":{"href":"https://github.com/edx/edx-platform/pull/2622#discussion_r10002818"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/2622"}}}}