Skip to content

Commit

Permalink
feat: final test in all automatic emails to add course images
Browse files Browse the repository at this point in the history
  • Loading branch information
BetoFandino committed Jun 26, 2024
1 parent ed4e19e commit 8635bc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lms/djangoapps/instructor/enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand All @@ -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,
Expand Down

0 comments on commit 8635bc6

Please sign in to comment.