Skip to content

Commit

Permalink
fix: fix cache_for_block_descendents cherry-pick test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed Jul 25, 2024
1 parent 970df54 commit 1754c44
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lms/djangoapps/mobile_api/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _last_visited_block_path(self, request, course):
the course block. If there is no such visit, the first item deep enough down the course
tree is used.
"""
field_data_cache = FieldDataCache.cache_for_block_descendents(
field_data_cache = FieldDataCache.cache_for_descriptor_descendents(
course.id, request.user, course, depth=2)

course_block = get_block_for_descriptor(
Expand Down Expand Up @@ -188,15 +188,14 @@ def _update_last_visited_module_id(self, request, course, module_key, modificati
"""
Saves the module id if the found modification_date is less recent than the passed modification date
"""
field_data_cache = FieldDataCache.cache_for_block_descendents(
field_data_cache = FieldDataCache.cache_for_descriptor_descendents(
course.id, request.user, course, depth=2)
try:
descriptor = modulestore().get_item(module_key)
block_descriptor = modulestore().get_item(module_key)
except ItemNotFoundError:
log.error(f"{errors.ERROR_INVALID_MODULE_ID} %s", module_key)
return Response(errors.ERROR_INVALID_MODULE_ID, status=400)
block = get_block_for_descriptor(
request.user, request, descriptor, field_data_cache, course.id, course=course
request.user, request, block_descriptor, field_data_cache, course.id, course=course
)

if modification_date:
Expand Down

0 comments on commit 1754c44

Please sign in to comment.