From aae6b92685ca2fdeb2fa99ea7677555372a574eb Mon Sep 17 00:00:00 2001 From: Daniel Valenzuela Date: Thu, 29 Feb 2024 03:32:59 -0300 Subject: [PATCH] refactor: rename to optional completion --- completion/services.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/completion/services.py b/completion/services.py index b5fbd7d..3effbd7 100644 --- a/completion/services.py +++ b/completion/services.py @@ -117,13 +117,14 @@ def vertical_is_complete(self, item): if not self.completion_tracking_enabled(): return None - optional_vertical = getattr(item, "optional_content", False) + optional_vertical = getattr(item, "optional_completion", 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) - # for non-optional verticals, only include non-optional children - if optional_vertical or not getattr(child, "optional_content", False) + # if vertical is optional, include all children + # else only include non-optional children + if optional_vertical or not getattr(child, "optional_completion", False) ] completions = self.get_completions(child_locations) for child_location in child_locations: