diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index 87bcfa7632..9487c0b01f 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -1428,10 +1428,10 @@ def _compute_visibility_state(xblock, child_info, is_unit_with_changes, is_cours return VisibilityState.live if is_live else VisibilityState.needs_attention else: return VisibilityState.ready if not is_unscheduled else VisibilityState.needs_attention - if is_unscheduled: - return VisibilityState.unscheduled - elif is_live: + if is_live: return VisibilityState.live + elif is_unscheduled: + return VisibilityState.unscheduled else: return VisibilityState.ready diff --git a/cms/djangoapps/contentstore/views/tests/test_item.py b/cms/djangoapps/contentstore/views/tests/test_item.py index f9cf6eeb16..0542a51461 100644 --- a/cms/djangoapps/contentstore/views/tests/test_item.py +++ b/cms/djangoapps/contentstore/views/tests/test_item.py @@ -3118,6 +3118,18 @@ class TestXBlockPublishingInfo(ItemTest): xblock_info = self._get_xblock_info(empty_chapter.location) self._verify_visibility_state(xblock_info, VisibilityState.unscheduled) + @ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split) + def test_chapter_self_paced_default_start_date(self, store_type): + course = CourseFactory.create(default_store=store_type) + course.self_paced = True + self.store.update_item(course, self.user.id) + chapter = self._create_child(course, 'chapter', "Test Chapter") + sequential = self._create_child(chapter, 'sequential', "Test Sequential") + self._create_child(sequential, 'vertical', "Published Unit", publish_item=True) + self._set_release_date(chapter.location, DEFAULT_START_DATE) + xblock_info = self._get_xblock_info(chapter.location) + self._verify_visibility_state(xblock_info, VisibilityState.live) + def test_empty_sequential(self): chapter = self._create_child(self.course, 'chapter', "Test Chapter") self._create_child(chapter, 'sequential', "Empty Sequential")