Skip to content

Commit c452fb3

Browse files
pkulkarkAgrendalath
andcommitted
refactor: rename descriptor -> block within lms/djangoapps/mobile_api
Co-authored-by: Agrendalath <[email protected]>
1 parent 4276e7d commit c452fb3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lms/djangoapps/mobile_api/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _decorator(func):
2929
def _wrapper(self, request, *args, **kwargs):
3030
"""
3131
Expects kwargs to contain 'course_id'.
32-
Passes the course descriptor to the given decorated function.
32+
Passes the course block to the given decorated function.
3333
Raises 404 if access to course is disallowed.
3434
"""
3535
course_id = CourseKey.from_string(kwargs.pop('course_id'))

lms/djangoapps/mobile_api/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class IgnoreMobileAvailableFlagConfig(ConfigurationModel):
9393
Configuration for the mobile_available flag. Default is false.
9494
9595
Enabling this configuration will cause the mobile_available flag check in
96-
access.py._is_descriptor_mobile_available to ignore the mobile_available
96+
access.py._is_block_mobile_available to ignore the mobile_available
9797
flag.
9898
9999
.. no_pii:

lms/djangoapps/mobile_api/users/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _last_visited_block_path(self, request, course):
140140
the course block. If there is no such visit, the first item deep enough down the course
141141
tree is used.
142142
"""
143-
field_data_cache = FieldDataCache.cache_for_descriptor_descendents(
143+
field_data_cache = FieldDataCache.cache_for_block_descendents(
144144
course.id, request.user, course, depth=2)
145145

146146
course_block = get_block_for_descriptor(
@@ -173,14 +173,14 @@ def _update_last_visited_module_id(self, request, course, module_key, modificati
173173
"""
174174
Saves the module id if the found modification_date is less recent than the passed modification date
175175
"""
176-
field_data_cache = FieldDataCache.cache_for_descriptor_descendents(
176+
field_data_cache = FieldDataCache.cache_for_block_descendents(
177177
course.id, request.user, course, depth=2)
178178
try:
179-
block_descriptor = modulestore().get_item(module_key)
179+
descriptor = modulestore().get_item(module_key)
180180
except ItemNotFoundError:
181181
return Response(errors.ERROR_INVALID_MODULE_ID, status=400)
182182
block = get_block_for_descriptor(
183-
request.user, request, block_descriptor, field_data_cache, course.id, course=course
183+
request.user, request, descriptor, field_data_cache, course.id, course=course
184184
)
185185

186186
if modification_date:

0 commit comments

Comments
 (0)