[BB-7296] Extend settings handler to be accessible via api#32127
[BB-7296] Extend settings handler to be accessible via api#32127pkulkark wants to merge 1 commit intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @pkulkark! As a core committer in this repo, you can merge this once the pull request is approved per the core committer reviewer requirements and according to the agreement with your edX Champion. |
cms/djangoapps/contentstore/rest_api/v0/views/details_settings.py
Outdated
Show resolved
Hide resolved
cms/djangoapps/contentstore/rest_api/v0/views/details_settings.py
Outdated
Show resolved
Hide resolved
83a189f to
e1a440d
Compare
0x29a
left a comment
There was a problem hiding this comment.
👍
- I tested this.
- I read through the changes.
|
Hi @pkulkark! Would you mind resolving the branch conflicts here? I will look into getting this reviewed. Thanks! |
e1a440d to
e8bfec0
Compare
e8bfec0 to
8bb915c
Compare
|
@mphilbrick211 Done. Please go ahead with the review. |
|
Hi @feanil! Ed thought you might be able to review/merge this one. Let me know if not. Thanks! |
feanil
left a comment
There was a problem hiding this comment.
At the very least we need to explain what the content of the patch body would look like and how a user of the API can know what valid values are.
| @verify_course_exists() | ||
| def patch(self, request: Request, course_id: str): | ||
| """ | ||
| Update a course's details settings. |
There was a problem hiding this comment.
This doesn't tell me anything about what settings can be in the patch. What settings can actually be updated by this API endpoint? Is that already documented somewhere and you can just point to that from here? If not, can you provide a list of the values that can be in the patch body? Also, is it possible to write a serializer for the data being output and input for these views? That would solve both the documentation issue and could be used to perform some basic validation on the input.
There was a problem hiding this comment.
@feanil This is meant to allow API access to the existing settings_handler which currently only allow session-based requests. It doesn't change any of its functionality. We added serializers for it in a separate django app (c.f. ref) which consumes this api along with the existing advanced_settings api. But you're right, I think we could still add one here like the CourseAdvancedSettingsSerializer. I'll add it and update here.
|
@pkulkark Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
This PR adds a new endpoint
details_settingsthat allows fetching and updating the course details settings, which previously could only be updated with a session-based request. With these changes, it can be updated with a token-based request. The changes are similar to what already exists foradvanced_settings.Supporting information
OpenCraft Internal Jira ticket: BB-7296
Testing instructions
GETandPATCHreturn the expected results.