TNL-6004 Fixing 500 in video transcripts.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user