fix: handle missing COMPLETION_AGGREGATOR_URL setting (#30331)

This commit is contained in:
Navin Karkera
2022-06-06 19:10:12 +05:30
committed by GitHub
parent 1c0219bdf0
commit aba1f052df
2 changed files with 3 additions and 3 deletions

View File

@@ -22,7 +22,7 @@ from openedx.features.course_experience import course_home_page_title, DISABLE_C
(course.enable_proctored_exams or course.enable_timed_exams)
)
completion_aggregator_url = settings.COMPLETION_AGGREGATOR_URL if settings.FEATURES.get("SHOW_PROGRESS_BAR", False) else ""
completion_aggregator_url = getattr(settings, "COMPLETION_AGGREGATOR_URL", "")
%>
<%def name="course_name()">
@@ -238,7 +238,7 @@ ${HTML(fragment.foot_html())}
<span class="nav-item nav-item-sequence">${sequence_title}</span>
% endif
</div>
% if settings.FEATURES.get("SHOW_PROGRESS_BAR", False):
% if settings.FEATURES.get("SHOW_PROGRESS_BAR", False) and completion_aggregator_url:
<div class="container">
<iframe style="border: none; height: 50px; position: relative; top: 10px; width: -webkit-fill-available" src="${completion_aggregator_url}/${course.id}/">
</iframe>

View File

@@ -117,7 +117,7 @@
${gated_sequence_paywall | n, decode.utf8}
% else:
<div class="sr-is-focusable" tabindex="-1"></div>
% if settings.FEATURES.get("SHOW_PROGRESS_BAR", False):
% if settings.FEATURES.get("SHOW_PROGRESS_BAR", False) and getattr(settings, 'COMPLETION_AGGREGATOR_URL', ''):
<div class="progress-container">
<iframe id="progress-frame" style="border: none; width: 100%; height: 70px;" src="${chapter_completion_aggregator_url}"></iframe>
</div>