Repository navigation
feat: apply NEW_COURSE_CATALOG_VISIBILITY in the course-create API - #397
Merged
Merged
Conversation
The course-create API calls modulestore().create_course directly and bypasses Studio, so it has to apply the platform's catalog visibility for new courses itself. No change while the setting is unset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /api/fx/courses/v1/courses/creates the course withmodulestore().create_course(...)directly, so it bypasses Studio's course-creation code. The platform fork is gaining an opt-in setting,NEW_COURSE_CATALOG_VISIBILITY(nelc/edx-platform#106), that makes new courses start with a configured catalogue visibility (for example hidden until an author publishes them). This applies the same setting here so API-created courses behave like Studio-created ones.Change
CourseCreateSerializer.create: whensettings.NEW_COURSE_CATALOG_VISIBILITYis set, addcatalog_visibilityto the fields passed tocreate_course. Unset /None/ not defined → no change.Testing
test_create_catalog_visibility_setting(set,None, not defined).flake8,pycodestyle,pydocstyle,isort --check-only,mypyclean;pylint10.00/10 on the changed files.Notes
update_course_discussions_settingscallsupdate_itemfrom the LMS withoutdraft_preferred— the same class of issue fixed for certificates in fix: write course certificate settings to the draft branch #395.🤖 Generated with Claude Code