Skip to content

Comments

Adds capability to ricecooker endpoints to specify an existing node for which the ricecooker user has permissions to copy into tree#4050

Merged
bjester merged 2 commits intolearningequality:unstablefrom
rtibbles:i_think_im_a_clone_now
May 11, 2023
Merged

Adds capability to ricecooker endpoints to specify an existing node for which the ricecooker user has permissions to copy into tree#4050
bjester merged 2 commits intolearningequality:unstablefrom
rtibbles:i_think_im_a_clone_now

Conversation

@rtibbles
Copy link
Member

@rtibbles rtibbles commented May 4, 2023

Summary

Description of the change(s) you made

  • Adds fix for copy operation to ensure that fields are not overwritten by the metadata overwriting function, if they should not be
  • Adds additional functionality to the add_nodes endpoint to allow ricecooker to create clones of existing resource nodes
  • Adds test coverage of the new functionality, particularly ensuring that topics cannot be cloned

Manual verification steps performed

  1. Ran this code
  2. Ran ricecooker with this PR Add StudioContentNode class to allow scripted curation of existing content from Studio ricecooker#412 against the development server
  3. Confirmed that a curated channel could be created

@rtibbles rtibbles force-pushed the i_think_im_a_clone_now branch from b108353 to e6886bc Compare May 4, 2023 23:04
Copy link
Member

@bjester bjester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

"suggested_duration",
}

EDIT_ALLOWED_OVERRIDES = ALLOWED_OVERRIDES.union({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With these 3 words all in the variable name, the variable's purpose took me a moment to decipher (thinking 'overrides' already feels like an 'edit'). Not sure if EDITOR makes it clearer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was not at the race for my variable naming this day. EDITOR does make a bit more sense, definitely.

"""

def _make_node_data(self):
random_data = mixer.blend(SampleContentNodeDataSchema)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I haven't seen this before

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, I copied this from elsewhere in the same file - so I can take 0 credit :)

@bjester bjester merged commit 5eaa4af into learningequality:unstable May 11, 2023
@rtibbles rtibbles deleted the i_think_im_a_clone_now branch May 11, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants