From 6b13eb25a6418a10e1d884fef67c1f87a6f0167a Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Fri, 9 Feb 2024 17:21:34 +0000 Subject: [PATCH] fix: link to instructor on http --- .../management/commands/export_course_certificates.py | 8 ++++---- .../commands/export_course_certificates_pdfs.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nau_openedx_extensions/management/commands/export_course_certificates.py b/nau_openedx_extensions/management/commands/export_course_certificates.py index f332c2c..94c1a6d 100644 --- a/nau_openedx_extensions/management/commands/export_course_certificates.py +++ b/nau_openedx_extensions/management/commands/export_course_certificates.py @@ -65,8 +65,8 @@ def handle(self, *args, **options): ) course_key = CourseKey.from_string(course_id) - lms_base = SiteConfiguration.get_value_for_org( - course_key.org, "LMS_BASE", settings.LMS_BASE + lms_root_url = SiteConfiguration.get_value_for_org( + course_key.org, "LMS_ROOT_URL", settings.LMS_ROOT_URL ) # prepare output @@ -89,7 +89,7 @@ def handle(self, *args, **options): # iterate each certificate and append each certificate as a row for certificate in course_generated_certificates: certificate_web_link_url = ( - "https://" + lms_base + "/certificates/" + certificate.verify_uuid + f"{lms_root_url}/certificates/{certificate.verify_uuid}" ) certificate_download_pdf_link = ( certificate_download_pdf_url + certificate.verify_uuid @@ -116,7 +116,7 @@ def handle(self, *args, **options): ) lms_instructor_data_download_url = ( - f"https://{lms_base}/courses/{course_id}/instructor#view-data_download" + f"{lms_root_url}/courses/{course_id}/instructor#view-data_download" ) self.log_msg( f"You can confirm the existence of the file on: {lms_instructor_data_download_url}" diff --git a/nau_openedx_extensions/management/commands/export_course_certificates_pdfs.py b/nau_openedx_extensions/management/commands/export_course_certificates_pdfs.py index e633641..8d12a7a 100644 --- a/nau_openedx_extensions/management/commands/export_course_certificates_pdfs.py +++ b/nau_openedx_extensions/management/commands/export_course_certificates_pdfs.py @@ -155,11 +155,11 @@ def handle(self, *args, **options): ) delete_recursive(course_certificate_folder) - lms_base = SiteConfiguration.get_value_for_org( - course_key.org, "LMS_BASE", settings.LMS_BASE + lms_root_url = SiteConfiguration.get_value_for_org( + course_key.org, "LMS_ROOT_URL", settings.LMS_ROOT_URL ) lms_instructor_data_download_url = ( - f"https://{lms_base}/courses/{course_id}/instructor#view-data_download" + f"{lms_root_url}/courses/{course_id}/instructor#view-data_download" ) self.log_msg( f"You can confirm the existence of the file on: {lms_instructor_data_download_url}"