Add support to ricecooker endpoint for metadata labels.#3407
Merged
rtibbles merged 1 commit intolearningequality:unstablefrom Jun 14, 2022
Merged
Add support to ricecooker endpoint for metadata labels.#3407rtibbles merged 1 commit intolearningequality:unstablefrom
rtibbles merged 1 commit intolearningequality:unstablefrom
Conversation
vkWeb
approved these changes
Jun 14, 2022
Member
vkWeb
left a comment
There was a problem hiding this comment.
Left a small suggestion. The code looks good. Added tests are passing. This can be merged.
| freeze_authoring_data=True, | ||
| role_visibility=node_data.get('role') or roles.LEARNER, | ||
| complete=is_complete, | ||
| **metadata_labels |
Member
There was a problem hiding this comment.
Should we be more explicit here by providing kwargs using metadata_labels?
Member
Author
There was a problem hiding this comment.
The intention here is to only set the kwargs for each of the metadata_labels keys if they have been set, so I don't think there's another way to do that except to explicitly write <kwarg>=metadata_labels.get("<kwarg>")
This was referenced Sep 15, 2022
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
Description of the change(s) you made
Adds support to the internal ricecooker endpoint to pass in a list of values for each of the new metadata labels.
Ensures it is a list of items and raises a 400 if not.
Validates the values against the internal constants and raises a 400 if invalid.
Sets the values on the model as a map that keys from the value to
True.Adds tests to the internal views tests to ensure this behaviour.
References
Fixes #3356