Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add more verbose logging around force_enrollment #34510

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions common/djangoapps/student/models/course_enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion openedx/features/enterprise_support/enrollments/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading