From 8635bc6cbd0ec942eabad7050f4fa33445de894c Mon Sep 17 00:00:00 2001 From: Beto Fandino Date: Wed, 26 Jun 2024 14:22:15 -0400 Subject: [PATCH] feat: final test in all automatic emails to add course images --- lms/djangoapps/instructor/enrollment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/instructor/enrollment.py b/lms/djangoapps/instructor/enrollment.py index 0ad1f98419..3fb55ea548 100644 --- a/lms/djangoapps/instructor/enrollment.py +++ b/lms/djangoapps/instructor/enrollment.py @@ -142,8 +142,6 @@ def enroll_email(course_id, student_email, auto_enroll=False, email_students=Fal """ previous_state = EmailEnrollmentState(course_id, student_email) enrollment_obj = None - course_module = modulestore().get_course(course_id, depth=0) - email_params['course_image_url'] = f'{settings.LMS_ROOT_URL}{course_image_url(course_module)}' if previous_state.user and previous_state.user.is_active: # if the student is currently unenrolled, don't enroll them in their # previous mode @@ -446,6 +444,7 @@ def get_email_params(course, auto_enroll, secure=True, course_key=None, display_ settings.CONTACT_MAILING_ADDRESS ) platform_name = configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME) + image_url = f'{settings.LMS_ROOT_URL}{course_image_url(course)}' # Composition of email email_params = { @@ -456,6 +455,7 @@ def get_email_params(course, auto_enroll, secure=True, course_key=None, display_ 'auto_enroll': auto_enroll, 'course_url': course_url, 'course_about_url': course_about_url, + 'course_image_url': image_url, 'is_shib_course': is_shib_course, 'contact_mailing_address': contact_mailing_address, 'platform_name': platform_name,