Commit f3a30e6f by attiyaishaque

TNL-6004 Fixing 500 in video transcripts.

parent ab44b12a
......@@ -1073,3 +1073,13 @@ class VideoDescriptorIndexingTestCase(unittest.TestCase):
descriptor = instantiate_descriptor(data=xml_data_transcripts)
validation = descriptor.validate()
self.assert_validation_message(validation, expected_validation_msg)
def test_video_transcript_none(self):
"""
Test video when transcripts is None.
"""
descriptor = instantiate_descriptor(data=None)
descriptor.transcripts = None
response = descriptor.get_transcripts_info()
expected = {'transcripts': {}, 'sub': ''}
self.assertEquals(expected, response)
......@@ -673,7 +673,7 @@ class VideoTranscriptsMixin(object):
transcripts = copy.deepcopy(get_bumper_settings(self).get('transcripts', {}))
sub = transcripts.pop("en", "")
else:
transcripts = self.transcripts
transcripts = self.transcripts if self.transcripts else {}
sub = self.sub
# Only attach transcripts that are not empty.
......
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