From f9356c78694e75a0eccb2f8308457f71bf00f3ba Mon Sep 17 00:00:00 2001 From: Rodrigo Martin Date: Mon, 18 Nov 2024 16:58:50 -0300 Subject: [PATCH] feat(AU-2283): Call get_available_transcript_languages outside loop --- edxval/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/edxval/views.py b/edxval/views.py index 647360ec..c563d74c 100644 --- a/edxval/views.py +++ b/edxval/views.py @@ -456,8 +456,9 @@ def post(self, request): status=status.HTTP_400_BAD_REQUEST, data={'message': f'Value for video "{video_id}" needs to be a list of language codes.'} ) + available_transcript_languages = get_available_transcript_languages(video_id=video_id) for language_code in language_codes: - if language_code not in get_available_transcript_languages(video_id=video_id): + if language_code not in available_transcript_languages: missing_transcripts.append(f'Language "{language_code}" is not available for video "{video_id}".') if missing_transcripts: