File tree Expand file tree Collapse file tree
cms/djangoapps/contentstore Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -283,7 +283,10 @@ def create_usage(self, def_id) -> UsageKey:
283283 def create_definition (self , block_type , slug = None ) -> DefinitionLocator :
284284 """ Generate a new definition_id for an XBlock """
285285 # Note: Split modulestore will detect this temporary ID and create a new definition ID when the XBlock is saved.
286- return DefinitionLocator (block_type , LocalId (block_type ))
286+ # FIXME: The DefinitionLocator technically only accepts an ObjectId (or a str representing an ObjectId), but
287+ # this code relies on passing a LocalId and having it save the LocalId object as its `definition_id`. We should
288+ # either change this in the future or update DefinitionLocator to support LocalId-typed definition IDs.
289+ return DefinitionLocator (block_type , LocalId (block_type )) # type: ignore[arg-type]
287290
288291
289292@frozen
You can’t perform that action at this time.
0 commit comments