Skip to content

Commit 829c1e1

Browse files
chore: explain mypy error and suppress it for now
1 parent d01125e commit 829c1e1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cms/djangoapps/contentstore/helpers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)