Commit e457135e by Alexander Kryklia

Merge pull request #2931 from edx/alex/allow_uppercase_srt_extension

Allow uppercase transcripts srt extension.
parents 891cf8bb 7fe675b1
......@@ -308,8 +308,9 @@ class TestGenerateSubsFromSource(TestDownloadYoutubeSubs):
""")
self.clear_subs_content(youtube_subs)
# Check transcripts_utils.TranscriptsGenerationException not thrown
transcripts_utils.generate_subs_from_source(youtube_subs, 'srt', srt_filedata, self.course)
# Check transcripts_utils.TranscriptsGenerationException not thrown.
# Also checks that uppercase file extensions are supported.
transcripts_utils.generate_subs_from_source(youtube_subs, 'SRT', srt_filedata, self.course)
# Check assets status after importing subtitles.
for subs_id in youtube_subs.values():
......
......@@ -213,7 +213,7 @@ def generate_subs_from_source(speed_subs, subs_type, subs_filedata, item, langua
:returns: True, if all subs are generated and saved successfully.
"""
_ = item.runtime.service(item, "i18n").ugettext
if subs_type != 'srt':
if subs_type.lower() != 'srt':
raise TranscriptsGenerationException(_("We support only SubRip (*.srt) transcripts format."))
try:
srt_subs_obj = SubRipFile.from_string(subs_filedata)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment