Skip to content

Allow deferral to a course run with past Upgrade Deadline #2570

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

Open
annagav opened this issue Mar 19, 2025 · 4 comments
Open

Allow deferral to a course run with past Upgrade Deadline #2570

annagav opened this issue Mar 19, 2025 · 4 comments
Assignees

Comments

@annagav
Copy link
Contributor

annagav commented Mar 19, 2025

Recently customer service has processing deferral to a course run for which upgrade deadline has passed.
This caused edx api call to fail, and a caused a recurring Sentry errors that keep trying to enroll the user in a verified mode.

Needs Discussion

@pdpinch
Copy link
Member

pdpinch commented Mar 24, 2025

@arslanashraf7 Can the open edX enrollment API allow for a user to be in verified mode even if the upgrade deadline is in the past?

@arslanashraf7
Copy link
Contributor

arslanashraf7 commented Mar 25, 2025

@arslanashraf7 Can the open edX enrollment API allow for a user to be in verified mode even if the upgrade deadline is in the past?

@pdpinch The edX code supports the enrollment after the upgrade deadline but with a force_enrollment flag in the API. The following utility method also has this flag here.

I also think we were using the force_enrollment flag in our enrollments and staff access token to enroll the users in edX, which means the users should be enrolled even after the deadline.

I looked at the MITx Online code briefly and found #1225 that explicitly added the option to enroll even after the deadline.

If the retry enrollments are breaking, we might need to check at that code and see if we are passing the force_enrollment there.

@annagav annagav self-assigned this Mar 25, 2025
@annagav
Copy link
Contributor Author

annagav commented Mar 25, 2025

@arslanashraf7 It looks like we are passing the force_enrollment flag
In enroll_in_edx_course_runs it is set by default to True.
We are getting this response (from the sentry error)

EdxApiEnrollErrorException
EdX API error enrolling user [email protected] ([email protected]) in course run 'course-v1:MITxT+JPAL102x+1T2024'.
Response - code: 400, content: {"message":"The [verified] course mode is expired or otherwise unavailable for course run [course-v1:MITxT+JPAL102x+1T2024].","course_details":{"course_id":"course-v1:MITxT+JPAL102x+1T2024","course_name":"Designing and Running Randomized Evaluations","enrollment_start":"2023-10-10T23:59:00Z","enrollment_end":"2024-02-13T23:59:00Z","course_start":"2024-01-16T15:00:00Z","course_end":"2024-07-02T00:00:00Z","invite_only":false,"course_modes":[{"slug":"audit","name":"audit","min_price":0,"suggested_prices":"","currency":"usd","expiration_datetime":null,"description":null,"sku":null,"bulk_sku":null}],"pacing_type":"Instructor Paced"}}

I have modified this enrollment manually to verified to fix this error.

@arslanashraf7
Copy link
Contributor

arslanashraf7 commented Mar 26, 2025

I looked more at why force_enrollment might not work here. I think in the case of this user, the Audit enrollment exists in both systems, and we are trying to update the enrollment to verified mode.

Here are the enrollments for this user:

  1. MItx Online Enrollment
  2. MITx Online edX enrollment

Now, when the error message in the above comment suggests that we were trying to move the user enrollment to verified?

What happens in this case is that edX runs update_enrollment instead of add_enrollment, which as of now doesn't seem to support force_enrollment and that's why we are seeing this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants