fix: do not instantiate the PartitionService during XBlock validation in Studio

This commit is contained in:
Agrendalath
2023-08-01 18:55:05 +02:00
committed by Piotr Surowiec
parent 0bde216d6f
commit f6a60cdc1c

View File

@@ -3287,7 +3287,11 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
Create the proper runtime for this course
"""
services = self.services
services["partitions"] = PartitionService(course_entry.course_key)
# Only the CourseBlock can have user partitions. Therefore, creating the PartitionService with the library key
# instead of the course key does not work. The XBlock validation in Studio fails with the following message:
# "This component's access settings refer to deleted or invalid group configurations.".
if not isinstance(course_entry.course_key, LibraryLocator):
services["partitions"] = PartitionService(course_entry.course_key)
return CachingDescriptorSystem(
modulestore=self,