Skip to content

Commit 1754c44

Browse files
committed
fix: fix cache_for_block_descendents cherry-pick test failures
1 parent 970df54 commit 1754c44

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lms/djangoapps/mobile_api/users/views.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def _last_visited_block_path(self, request, course):
155155
the course block. If there is no such visit, the first item deep enough down the course
156156
tree is used.
157157
"""
158-
field_data_cache = FieldDataCache.cache_for_block_descendents(
158+
field_data_cache = FieldDataCache.cache_for_descriptor_descendents(
159159
course.id, request.user, course, depth=2)
160160

161161
course_block = get_block_for_descriptor(
@@ -188,15 +188,14 @@ def _update_last_visited_module_id(self, request, course, module_key, modificati
188188
"""
189189
Saves the module id if the found modification_date is less recent than the passed modification date
190190
"""
191-
field_data_cache = FieldDataCache.cache_for_block_descendents(
191+
field_data_cache = FieldDataCache.cache_for_descriptor_descendents(
192192
course.id, request.user, course, depth=2)
193193
try:
194-
descriptor = modulestore().get_item(module_key)
194+
block_descriptor = modulestore().get_item(module_key)
195195
except ItemNotFoundError:
196-
log.error(f"{errors.ERROR_INVALID_MODULE_ID} %s", module_key)
197196
return Response(errors.ERROR_INVALID_MODULE_ID, status=400)
198197
block = get_block_for_descriptor(
199-
request.user, request, descriptor, field_data_cache, course.id, course=course
198+
request.user, request, block_descriptor, field_data_cache, course.id, course=course
200199
)
201200

202201
if modification_date:

0 commit comments

Comments
 (0)