Skip to content

Commit

Permalink
feat(AU-2283): Call get_available_transcript_languages outside loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodra committed Nov 18, 2024
1 parent c399085 commit f9356c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion edxval/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f9356c7

Please sign in to comment.