refactor: remove an extra call for getting waffle flag
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
<%!
|
||||
from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
|
||||
from openedx.core.djangoapps.discussions.config.waffle import ENABLE_PAGES_AND_RESOURCES_MICROFRONTEND
|
||||
from cms.djangoapps.contentstore.utils import get_pages_and_resources_url
|
||||
%>
|
||||
|
||||
@@ -40,8 +39,8 @@ CMS.URL.LMS_BASE = "${settings.LMS_BASE | n, js_escaped_string}"
|
||||
<div class="wrapper-mast wrapper">
|
||||
% if context_course:
|
||||
<%
|
||||
pages_and_resources_mfe_enabled = ENABLE_PAGES_AND_RESOURCES_MICROFRONTEND.is_enabled(context_course.id)
|
||||
course_key = context_course.id
|
||||
pages_and_resources_mfe_url = get_pages_and_resources_url(context_course.id)
|
||||
pages_and_resources_mfe_enabled = bool(pages_and_resources_mfe_url)
|
||||
%>
|
||||
% endif
|
||||
|
||||
@@ -55,7 +54,7 @@ CMS.URL.LMS_BASE = "${settings.LMS_BASE | n, js_escaped_string}"
|
||||
<span class="spacer"> ›</span>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="title" href="${get_pages_and_resources_url(course_key)}" rel="external">${_("Pages & Resources")}</a>
|
||||
<a class="title" href="${pages_and_resources_mfe_url}" rel="external">${_("Pages & Resources")}</a>
|
||||
<span class="spacer"> ›</span>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user