Skip to content

Commit

Permalink
fix: in generate_block_key, get the usage key's block_id, not usage_id
Browse files Browse the repository at this point in the history
UsageKeys don't have a usage_id field. This line would have crashed
if run.
  • Loading branch information
kdmccormick committed Jan 16, 2024
1 parent e8b60ae commit ef0fc97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/content_libraries/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def generate_block_key(source_key, dest_parent_key):
branch='library'
)
derived_block_key = derive_key(
source=source_key_as_v1_course_key.make_usage_key(source_key.block_type, source_key.usage_id),
source=source_key_as_v1_course_key.make_usage_key(source_key.block_type, source_key.block_id),
dest_parent=BlockKey(dest_parent_key.block_type, dest_parent_key.block_id),
)
return dest_parent_key.context_key.make_usage_key(*derived_block_key)
Expand Down

0 comments on commit ef0fc97

Please sign in to comment.