-
Notifications
You must be signed in to change notification settings - Fork 3
canvas - separate courses per session #2347
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
base: main
Are you sure you want to change the base?
Conversation
run_id=f"{readable_id}+canvas", learning_resource=resource, published=True | ||
run_id=f"{readable_id}+canvas", | ||
learning_resource=resource, | ||
published=True, |
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.
New session-specific courses were created, but the 2 older courses from an earlier command run are still present with test_mode=True
. I think any courses not found in the archives during a command run should probably be deleted and/or have test_mode set to False
(in addition to published=False
), with all their contentfiles deleted or unpublished from regular and vector search.
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 added the deletion of stale canvas courses. Retrieving the current course ids required going into the archive so i funnel up the relevant readable ids and at the end of the command do a deletion+deindex. This also only applies when running the management command since the webhook just tells us to add a new entry.
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/7772
Description (What does it do?)
This PR makes it so that the course folder is included in the readable id when creating canvas learning resource objects.
How can this be tested?
python manage.py backpopulate_canvas_courses
or check via admin: http://open.odl.local:8063/admin/learning_resources/learningresource/?etl_source=canvas
5. note that the readable ids should look like "{folder_name}-{course_id}"
Additional Context
In the initial implementation we expected the course id in the course_settings.xml to be unique which turned out to not be the case between sessions. This pr resolves that issue.