Skip to content

Commit

Permalink
fix: [FC-0056] fix caching condition, and extend docsting
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed May 23, 2024
1 parent d40f3b8 commit 1056593
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lms/djangoapps/course_home_api/outline/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ def get(self, request, *args, **kwargs):
is_masquerading=user_is_masquerading,
)
if navigation_sidebar_caching_is_disabled := courseware_disable_navigation_sidebar_blocks_caching():
course_blocks = cache.get(cache_key)
else:
course_blocks = None
else:
course_blocks = cache.get(cache_key)

if not course_blocks:
if getattr(enrollment, 'is_active', False) or bool(staff_access):
Expand Down Expand Up @@ -533,6 +533,11 @@ def mark_complete_recursive(self, block):
def get_block_completion_stat(self, block, completable_children):
"""
Get the completion status of a block.
Returns dictionary with the completion status and the number
of completable children of a block.
Completion is the value from 0 to 1 meaning the percentage of completion for lower-level blocks,
and sum of the completion status of the completable children.
"""
block_type = block['type']
completable_children_num = len(completable_children)
Expand Down

0 comments on commit 1056593

Please sign in to comment.