diff --git a/common/djangoapps/student/models/course_enrollment.py b/common/djangoapps/student/models/course_enrollment.py index d89a8d967a00..318a3afd8316 100644 --- a/common/djangoapps/student/models/course_enrollment.py +++ b/common/djangoapps/student/models/course_enrollment.py @@ -683,9 +683,10 @@ def enroll(cls, user, course_key, mode=None, check_access=False, can_upgrade=Fal if check_access: if cls.is_enrollment_closed(user, course) and not can_upgrade: log.warning( - "User %s failed to enroll in course %s because enrollment is closed", + "User %s failed to enroll in course %s because enrollment is closed (can_upgrade=%s).", user.username, - str(course_key) + str(course_key), + can_upgrade, ) raise EnrollmentClosedError diff --git a/openedx/features/enterprise_support/enrollments/utils.py b/openedx/features/enterprise_support/enrollments/utils.py index b64ff971b769..e0d5f65aedde 100644 --- a/openedx/features/enterprise_support/enrollments/utils.py +++ b/openedx/features/enterprise_support/enrollments/utils.py @@ -133,12 +133,13 @@ def lms_update_or_create_enrollment( except (CourseEnrollmentError, CourseEnrollmentNotUpdatableError) as error: log.exception( "Raising error [%s] for user " - "[%s]: course run = [%s], enterprise_uuid = [%s], is_active = [%s], ", + "[%s]: course run = [%s], enterprise_uuid = [%s], is_active = [%s], force_enrollment = [%s], ", error, username, course_id, str(enterprise_uuid), is_active, + force_enrollment, ) raise error finally: