feat: use function to access xpert translations ui waffle flag
This commit is contained in:
@@ -77,6 +77,7 @@ from cms.djangoapps.contentstore.toggles import (
|
||||
use_new_video_uploads_page,
|
||||
use_new_custom_pages,
|
||||
use_tagging_taxonomy_list_page,
|
||||
# use_xpert_translations_component,
|
||||
)
|
||||
from cms.djangoapps.models.settings.course_grading import CourseGradingModel
|
||||
from xmodule.library_tools import LibraryToolsService
|
||||
@@ -1595,7 +1596,7 @@ def get_course_videos_context(course_block, pagination_conf, course_key=None):
|
||||
get_transcript_preferences,
|
||||
)
|
||||
from openedx.core.djangoapps.video_config.models import VideoTranscriptEnabledFlag
|
||||
from openedx.core.djangoapps.video_config.toggles import XPERT_TRANSLATIONS_UI
|
||||
from openedx.core.djangoapps.video_config.toggles import use_xpert_translations_component
|
||||
from xmodule.video_block.transcripts_utils import Transcript # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
from .video_storage_handlers import (
|
||||
@@ -1620,7 +1621,7 @@ def get_course_videos_context(course_block, pagination_conf, course_key=None):
|
||||
course = modulestore().get_course(course_key)
|
||||
|
||||
is_video_transcript_enabled = VideoTranscriptEnabledFlag.feature_enabled(course.id)
|
||||
is_ai_translations_enabled = XPERT_TRANSLATIONS_UI.is_enabled(course.id)
|
||||
is_ai_translations_enabled = use_xpert_translations_component(course.id)
|
||||
previous_uploads, pagination_context = _get_index_videos(course, pagination_conf)
|
||||
course_video_context = {
|
||||
'context_course': course,
|
||||
|
||||
@@ -37,3 +37,10 @@ TRANSCRIPT_FEEDBACK = CourseWaffleFlag(
|
||||
XPERT_TRANSLATIONS_UI = CourseWaffleFlag(
|
||||
f'{WAFFLE_FLAG_NAMESPACE}.xpert_translations_ui', __name__
|
||||
)
|
||||
|
||||
|
||||
def use_xpert_translations_component(course_key):
|
||||
"""
|
||||
Returns a boolean if xpert translations ui component is enabled
|
||||
"""
|
||||
return XPERT_TRANSLATIONS_UI.is_enabled(course_key)
|
||||
|
||||
Reference in New Issue
Block a user