Skip to content

Conversation

@muhammad-ammar
Copy link
Contributor

@muhammad-ammar muhammad-ammar commented Apr 11, 2018

With these changes Transcripts column on Video Uploads page will be enabled by default.

SANDBOX

@muhammad-ammar muhammad-ammar force-pushed the ammar/EDUCATOR-1759-delete-transcript-from-advance-tab branch from 028a928 to c675b8c Compare April 11, 2018 11:07
@edx-status-bot
Copy link

Your PR has finished running tests.

@muhammad-ammar muhammad-ammar force-pushed the ammar/remove-video-transcript-enabled-flag branch from dab7440 to 6b7a72a Compare April 11, 2018 14:12
@edx-status-bot
Copy link

Your PR has finished running tests.

@muhammad-ammar muhammad-ammar force-pushed the ammar/remove-video-transcript-enabled-flag branch from 6b7a72a to b6c27a6 Compare April 12, 2018 06:11
@edx-status-bot
Copy link

Your PR has finished running tests.

@muhammad-ammar muhammad-ammar force-pushed the ammar/EDUCATOR-1759-delete-transcript-from-advance-tab branch from 6e1784f to 6784ee7 Compare April 12, 2018 19:54
@muhammad-ammar muhammad-ammar force-pushed the ammar/remove-video-transcript-enabled-flag branch from b6c27a6 to 0f34796 Compare April 13, 2018 06:57
@edx-status-bot
Copy link

Your PR has finished running tests.

@muhammad-ammar muhammad-ammar force-pushed the ammar/EDUCATOR-1759-delete-transcript-from-advance-tab branch from 6784ee7 to f2b499e Compare April 23, 2018 12:54
@muhammad-ammar muhammad-ammar force-pushed the ammar/remove-video-transcript-enabled-flag branch from 0f34796 to d95fb31 Compare April 23, 2018 13:20
@muhammad-ammar muhammad-ammar force-pushed the ammar/EDUCATOR-1759-delete-transcript-from-advance-tab branch from f2b499e to 82d0968 Compare April 23, 2018 13:45
@edx-status-bot
Copy link

Your PR has finished running tests.

@muhammad-ammar muhammad-ammar force-pushed the ammar/EDUCATOR-1759-delete-transcript-from-advance-tab branch from 82d0968 to d5758bd Compare April 24, 2018 11:50
@muhammad-ammar muhammad-ammar force-pushed the ammar/remove-video-transcript-enabled-flag branch from d95fb31 to a1e5931 Compare April 24, 2018 11:54
@edx-status-bot
Copy link

Your PR has finished running tests.

@muhammad-ammar muhammad-ammar changed the base branch from ammar/EDUCATOR-1759-delete-transcript-from-advance-tab to transcripts-phase-2 April 25, 2018 13:27
@muhammad-ammar muhammad-ammar force-pushed the ammar/remove-video-transcript-enabled-flag branch from a1e5931 to dbec3aa Compare April 25, 2018 14:23
@edx-status-bot
Copy link

Your PR has finished running tests.

@muhammad-ammar muhammad-ammar force-pushed the ammar/remove-video-transcript-enabled-flag branch from dbec3aa to cc8d288 Compare April 26, 2018 03:59
@edx-status-bot
Copy link

Your PR has finished running tests.

@muhammad-ammar
Copy link
Contributor Author

@mushtaqak This is waiting for your review

Copy link
Contributor

@mushtaqak mushtaqak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muhammad-ammar This is looking great. I have left a few questions and feedback.

Also, I think, openedx.core.djangoapps.video_config.models.VideoTranscriptEnabledFlag.feature_enabled could/may be removed from test_video_handlers.py and lms/djangoapps/mobile_api/video_outlines/tests.py

subs_filename,
get_transcript_for_video
)
from .transcripts_model_utils import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove is_val_transcript_feature_enabled_for_course method from transcript_model_utils.py since it is not used anymore now.

response = self.client.get(self.view_url, content_type='application/json')
self.assertEqual(response.status_code, 405)

def test_404_with_feature_disabled(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should be removed as well.

response = self.client.post(transcript_delete_url)
self.assertEqual(response.status_code, 405)

def test_404_with_feature_disabled(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name of the class should be renamed from TranscriptUploadTest to TranscriptDeleteTest and

@patch(
    'openedx.core.djangoapps.video_config.models.VideoTranscriptEnabledFlag.feature_enabled',
    Mock(return_value=True)
)

should be removed from the class as well.

@@ -504,16 +480,6 @@ def test_405_with_not_allowed_request_method(self):
response = self.client.post(transcript_delete_url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also let's make this consistent with other tests (self.view_url) as we have done for other views

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is out of scope of this PR :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM, I found that this is required for has_studio_write_access permission used in delete handler.

video_transcripts_enabled = VideoTranscriptEnabledFlag.feature_enabled(course_key)
# User needs to have studio write access for this course.
if not video_transcripts_enabled or not has_studio_write_access(request.user, course_key):
if not has_studio_write_access(request.user, course_key):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to check write access here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so that not everyone can delete the transcript

var view = new PreviousVideoUploadListView({
collection: collection,
videoHandlerUrl: videoHandlerUrl,
transcriptAvailableLanguages: [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding these attributes now ?

@muhammad-ammar
Copy link
Contributor Author

@mushtaqak feedback addressed.

@edx-status-bot
Copy link

Your PR has finished running tests.

Mock(return_value=False),
)
@patch('xmodule.video_module.VideoModule.get_transcript', Mock(side_effect=NotFoundError))
def test_download_fallback_transcript_feature_disabled(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this test now ? or it's docstring need to be update?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted as I don't think we need these now.

)
@patch(
'xmodule.video_module.transcripts_utils.edxval_api.get_available_transcript_languages',
Mock(return_value=['uk']),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test test_val_transcript_feature_disabled needed now? or it's docstring need to be update?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted as I don't think we need these now.

Copy link
Contributor

@mushtaqak mushtaqak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except a couple of questions, otherwise 👍

@muhammad-ammar muhammad-ammar force-pushed the ammar/remove-video-transcript-enabled-flag branch from 6a8ea29 to aaaafee Compare April 30, 2018 10:59
@muhammad-ammar
Copy link
Contributor Author

@mushtaqak I have rebased and squashed the PR. Will merge it as soon as build is gree.

@edx-status-bot
Copy link

Your PR has finished running tests.

@muhammad-ammar muhammad-ammar merged commit 16b0070 into transcripts-phase-2 Apr 30, 2018
@UmanShahzad UmanShahzad deleted the ammar/remove-video-transcript-enabled-flag branch May 9, 2018 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants