diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ea60aa9..bd15306 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,10 @@ Change Log Unreleased ~~~~~~~~~~ +[4.5.0] - 2024-02-26 +~~~~~~~~~~~~~~~~~~~~ +* Ignore optional blocks in non-optional verticals + [4.4.1] - 2023-10-27 ~~~~~~~~~~~~~~~~~~~~ * Fix RemovedInDjango41Warning by removing `django_app_config` diff --git a/completion/__init__.py b/completion/__init__.py index 8050a70..142bd91 100644 --- a/completion/__init__.py +++ b/completion/__init__.py @@ -3,4 +3,4 @@ """ -__version__ = '4.4.1' +__version__ = '4.5.0' diff --git a/completion/services.py b/completion/services.py index 14174e2..b5fbd7d 100644 --- a/completion/services.py +++ b/completion/services.py @@ -117,8 +117,14 @@ def vertical_is_complete(self, item): if not self.completion_tracking_enabled(): return None + optional_vertical = getattr(item, "optional_content", False) + # this is temporary local logic and will be removed when the whole course tree is included in completion - child_locations = [child.scope_ids.usage_id for child in self.get_completable_children(item)] + child_locations = [ + child.scope_ids.usage_id for child in self.get_completable_children(item) + # for non-optional verticals, only include non-optional children + if optional_vertical or not getattr(child, "optional_content", False) + ] completions = self.get_completions(child_locations) for child_location in child_locations: if completions[child_location] < 1.0: