Merge pull request #19478 from edx/hide-empty-content-course-blocks

REVE-181: Hide empty container blocks from the course blocks api when called by the mobile app
This commit is contained in:
Calen Pennington
2018-12-21 10:22:59 -05:00
committed by GitHub
5 changed files with 110 additions and 4 deletions

View File

@@ -149,6 +149,7 @@ class SampleCourseFactory(CourseFactory):
block_info_tree = kwargs.pop('block_info_tree', default_block_info_tree)
store = kwargs.get('modulestore')
user_id = kwargs.get('user_id', ModuleStoreEnum.UserID.test)
with store.branch_setting(ModuleStoreEnum.Branch.draft_preferred, None):
course = super(SampleCourseFactory, cls)._create(target_class, **kwargs)