fix: suppress errors+warnings when video is used in a content library (#35544)

This commit is contained in:
Braden MacDonald
2024-09-26 09:35:17 -07:00
committed by GitHub
parent 8f47c0b274
commit 67b490cab4
3 changed files with 16 additions and 7 deletions

View File

@@ -649,6 +649,9 @@ def _get_item(request, data):
Returns the item.
"""
usage_key = UsageKey.from_string(data.get('locator'))
if not usage_key.context_key.is_course:
# TODO: implement transcript support for learning core / content libraries.
raise TranscriptsRequestValidationException(_('Transcripts are not yet supported in content libraries.'))
# This is placed before has_course_author_access() to validate the location,
# because has_course_author_access() raises r if location is invalid.
item = modulestore().get_item(usage_key)