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

[REFERENCE] fix: ensure course run key is passed in legacy enrollment urls #1017

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adamstankiewicz
Copy link
Member

@adamstankiewicz adamstankiewicz commented Dec 16, 2024

While further triaging https://2u-internal.atlassian.net/browse/ENT-9770, we raised the question of WHY learners are seemingly visiting the legacy enrollment_url with a top-level course key vs. an explicit course run key.

When this occurs, it seems the InvalidKeyError is raised, regardless of the /enroll suffix being included in the course identifier passed to CourseKey.from_string(...).

This PR demonstrates a possible fix for what seems like a bug where generating an enrollment_url for a ContentMetadata record with content_type="course" results in the top-level course key being included instead. The proposed fix here would be to resolve the advertised course run key to use in the enrollment_url instead of the top-level course key, which should also help mitigate the InvalidKeyError error.

In theory, no InvalidKeyError errors should be raised from this legacy enrollment view.

Post-review

  • Squash commits into discrete sets of changes
  • Ensure that once the changes have been deployed to stage, prod is manually deployed

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

Successfully merging this pull request may close these issues.

1 participant