-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix: cast course_id to CourseKey when loading CourseOverview #29686
Conversation
Thanks for the pull request, @mariajgrimaldi! I've created OSPR-6351 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
@mariajgrimaldi Thank you for your contribution. This is ready for our review, correct? |
Hi @natabene! Happy new year. Yes, this is ready for review. |
@natabene, can I review this one? |
@Agrendalath Thanks for offering, please feel free to review and provide feedback. Our team will also want to review. |
bc9fab9
to
af3479d
Compare
Hi there @Agrendalath! Thanks for the review. It took me a while to come back to this issue 😅 Let me know what do you need to move this forward:smile: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- I tested this: verified that this fixes the falsy assertion
- I read through the code
- I checked for accessibility issues: n/a
- Includes documentation: n/a
- I made sure any change in configuration variables is reflected in the corresponding client's
configuration-secure
repository: n/a
Hi @mariajgrimaldi. This looks good to me. Just please amend the Thank you for providing extensive info in the PR's description! cc: @natabene |
af3479d
to
d4ba5cc
Compare
Hi @natabene, you mentioned your team would want to review; who should we mention? 🤔 |
@mariajgrimaldi It is actually my team :) We will look into this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mariajgrimaldi & @Agrendalath!
@mariajgrimaldi 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
EdX Release Notice: This PR has been deployed to the production environment. |
Description
When creating a course mode using the API for a course which course overview object version is less than the CourseOverview class version, an assertion error is raised.
This happens because the API serializer calls CourseOverview.get_from_id (here) with a bare string, and then loads the course overview from the modulestore if the version condition is met (here). When the method tries to load the object with the string as an identifier, raises the assertion error(here).
Supporting information
The course modes API was created based on this Jira issue
Testing instructions
With a course that meets the requirement
instance.version < CourseOverview.version
make the following callThat results in:
Then make the change, and you'll be able to create the course mode.
Other information
We found this error in our Lilac staging version while creating course modes through this new feature with course overviews taken from juniper DB backups.