From 2b3a16c614ad0ef5df9054d704ebbd862dc365ef Mon Sep 17 00:00:00 2001 From: Shadi Naif Date: Thu, 1 Dec 2022 12:35:26 +0300 Subject: [PATCH 1/2] Upgrade django static import --- lms/templates/footer-extra.html | 2 +- lms/templates/head-extra.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/templates/footer-extra.html b/lms/templates/footer-extra.html index 10edc8b9..456f014e 100644 --- a/lms/templates/footer-extra.html +++ b/lms/templates/footer-extra.html @@ -1,4 +1,4 @@ -<%! from django.contrib.staticfiles.templatetags.staticfiles import static %> +<%! from django.templatetags.static import static %> ## mako diff --git a/lms/templates/head-extra.html b/lms/templates/head-extra.html index 6a6642dc..2834c072 100644 --- a/lms/templates/head-extra.html +++ b/lms/templates/head-extra.html @@ -2,7 +2,7 @@ <%namespace name='static' file='/static_content.html'/> <%namespace file='/theme-variables.html' import="get_global_settings, get_brand_favicon" /> <%! from openedx.core.djangoapps.site_configuration.helpers import get_current_site_configuration, get_value %> -<%! from django.contrib.staticfiles.templatetags.staticfiles import static %> +<%! from django.templatetags.static import static %> <%! from openedx.core.lib.courses import course_image_url %> <% style_overrides_file = get_value('css_overrides_file') %> From d6b437def3f89fc58247b6d99f677f239d8c0ca1 Mon Sep 17 00:00:00 2001 From: Shadi Naif Date: Thu, 1 Dec 2022 12:37:42 +0300 Subject: [PATCH 2/2] Fix short imports --- .../dashboard/_dashboard_certificate_information.html | 2 +- lms/templates/dashboard/_dashboard_course_listing.html | 4 ++-- .../_dashboard-course-listing-01.html | 4 ++-- .../design-templates/pages/dashboard/_dashboard-01.html | 4 ++-- lms/templates/header/brand.html | 2 +- lms/templates/header/header.html | 2 +- lms/templates/header/navbar-logo-header.html | 1 - lms/templates/main.html | 3 +-- lms/templates/theme-variables.html | 2 +- 9 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lms/templates/dashboard/_dashboard_certificate_information.html b/lms/templates/dashboard/_dashboard_certificate_information.html index 61b21961..7aa705a4 100644 --- a/lms/templates/dashboard/_dashboard_certificate_information.html +++ b/lms/templates/dashboard/_dashboard_certificate_information.html @@ -4,7 +4,7 @@ from django.utils.translation import ugettext as _ from openedx.core.djangolib.markup import HTML, Text from course_modes.models import CourseMode -from util.course import should_display_grade +from common.djangoapps.util.course import should_display_grade %> <%namespace name='static' file='../static_content.html'/> diff --git a/lms/templates/dashboard/_dashboard_course_listing.html b/lms/templates/dashboard/_dashboard_course_listing.html index aed78194..4772ba4c 100644 --- a/lms/templates/dashboard/_dashboard_course_listing.html +++ b/lms/templates/dashboard/_dashboard_course_listing.html @@ -12,7 +12,7 @@ from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string from openedx.core.djangolib.markup import HTML, Text from openedx.features.course_experience import course_home_url_name -from student.helpers import ( +from common.djangoapps.student.helpers import ( VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_RESUBMITTED, @@ -21,7 +21,7 @@ VERIFY_STATUS_NEED_TO_REVERIFY, DISABLE_UNENROLL_CERT_STATES, ) -from util.course import get_link_for_about_page, get_encoded_course_sharing_utm_params +from common.djangoapps.util.course import get_link_for_about_page, get_encoded_course_sharing_utm_params %> <% diff --git a/lms/templates/design-templates/live-blocks/dashboard-course-listing/_dashboard-course-listing-01.html b/lms/templates/design-templates/live-blocks/dashboard-course-listing/_dashboard-course-listing-01.html index 498dd0a2..5c1bace5 100644 --- a/lms/templates/design-templates/live-blocks/dashboard-course-listing/_dashboard-course-listing-01.html +++ b/lms/templates/design-templates/live-blocks/dashboard-course-listing/_dashboard-course-listing-01.html @@ -12,7 +12,7 @@ from openedx.core.djangolib.js_utils import dump_js_escaped_json from openedx.core.djangolib.markup import HTML, Text from openedx.features.course_experience import course_home_url_name -from student.helpers import ( +from common.djangoapps.student.helpers import ( VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_RESUBMITTED, @@ -21,7 +21,7 @@ VERIFY_STATUS_NEED_TO_REVERIFY, DISABLE_UNENROLL_CERT_STATES, ) -from util.course import get_link_for_about_page, get_encoded_course_sharing_utm_params +from common.djangoapps.util.course import get_link_for_about_page, get_encoded_course_sharing_utm_params %> <% diff --git a/lms/templates/design-templates/pages/dashboard/_dashboard-01.html b/lms/templates/design-templates/pages/dashboard/_dashboard-01.html index 56ebdd18..244fa084 100644 --- a/lms/templates/design-templates/pages/dashboard/_dashboard-01.html +++ b/lms/templates/design-templates/pages/dashboard/_dashboard-01.html @@ -1,8 +1,8 @@ <%! from django.utils.translation import ugettext as _ from django.urls import reverse -from student.models import CourseEnrollment -from entitlements.models import CourseEntitlement +from common.djangoapps.student.models import CourseEnrollment +from common.djangoapps.entitlements.models import CourseEntitlement from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers %> diff --git a/lms/templates/header/brand.html b/lms/templates/header/brand.html index 2ad7c3d9..3b473c66 100644 --- a/lms/templates/header/brand.html +++ b/lms/templates/header/brand.html @@ -10,7 +10,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers # App that handles subdomain specific branding -from branding import api as branding_api +from lms.djangoapps.branding import api as branding_api %>

diff --git a/lms/templates/header/header.html b/lms/templates/header/header.html index a36ec8e4..8b63395f 100644 --- a/lms/templates/header/header.html +++ b/lms/templates/header/header.html @@ -12,7 +12,7 @@ from openedx.core.djangolib.markup import HTML, Text # App that handles subdomain specific branding -from branding import api as branding_api +from lms.djangoapps.branding import api as branding_api from openedx.core.djangoapps.lang_pref.api import header_language_selector_is_enabled, released_languages from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers diff --git a/lms/templates/header/navbar-logo-header.html b/lms/templates/header/navbar-logo-header.html index 0e5ce86c..29ea3b6a 100644 --- a/lms/templates/header/navbar-logo-header.html +++ b/lms/templates/header/navbar-logo-header.html @@ -9,7 +9,6 @@ from lms.djangoapps.ccx.overrides import get_current_ccx # App that handles subdomain specific branding -from branding import api as branding_api %> <%namespace file='/theme-variables.html' import="get_global_settings, get_brand_logos" /> diff --git a/lms/templates/main.html b/lms/templates/main.html index 37a43255..fd41fbf5 100644 --- a/lms/templates/main.html +++ b/lms/templates/main.html @@ -15,7 +15,6 @@ <% online_help_token = self.online_help_token() if hasattr(self, 'online_help_token') else None %> <%! import six -from branding import api as branding_api from django.urls import reverse from django.utils.http import urlquote_plus from django.utils.translation import ugettext as _ @@ -24,7 +23,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string from openedx.core.release import RELEASE_LINE -from pipeline_mako import render_require_js_path_overrides +from common.djangoapps.pipeline_mako import render_require_js_path_overrides %> diff --git a/lms/templates/theme-variables.html b/lms/templates/theme-variables.html index 0cb09b52..162ae45b 100644 --- a/lms/templates/theme-variables.html +++ b/lms/templates/theme-variables.html @@ -1,7 +1,7 @@ ## mako <%! from openedx.core.djangoapps.site_configuration.helpers import get_current_site_configuration, get_value %> <%! from openedx.core.djangoapps.site_configuration.models import SiteConfiguration %> -<%! from django.contrib.staticfiles.templatetags.staticfiles import static %> +<%! from django.templatetags.static import static %> <%! from django.utils.translation import ugettext as _ %> <%! from datetime import datetime %>