Skip to content

Commit

Permalink
refactor: rename descriptor -> block within lms/djangoapps/mobile_api
Browse files Browse the repository at this point in the history
Co-authored-by: Agrendalath <piotr@surowiec.it>
  • Loading branch information
pkulkark and Agrendalath committed Apr 26, 2023
1 parent 4276e7d commit c452fb3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lms/djangoapps/mobile_api/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _decorator(func):
def _wrapper(self, request, *args, **kwargs):
"""
Expects kwargs to contain 'course_id'.
Passes the course descriptor to the given decorated function.
Passes the course block to the given decorated function.
Raises 404 if access to course is disallowed.
"""
course_id = CourseKey.from_string(kwargs.pop('course_id'))
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/mobile_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class IgnoreMobileAvailableFlagConfig(ConfigurationModel):
Configuration for the mobile_available flag. Default is false.
Enabling this configuration will cause the mobile_available flag check in
access.py._is_descriptor_mobile_available to ignore the mobile_available
access.py._is_block_mobile_available to ignore the mobile_available
flag.
.. no_pii:
Expand Down
8 changes: 4 additions & 4 deletions lms/djangoapps/mobile_api/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,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_descriptor_descendents(
field_data_cache = FieldDataCache.cache_for_block_descendents(
course.id, request.user, course, depth=2)

course_block = get_block_for_descriptor(
Expand Down Expand Up @@ -173,14 +173,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_descriptor_descendents(
field_data_cache = FieldDataCache.cache_for_block_descendents(
course.id, request.user, course, depth=2)
try:
block_descriptor = modulestore().get_item(module_key)
descriptor = modulestore().get_item(module_key)
except ItemNotFoundError:
return Response(errors.ERROR_INVALID_MODULE_ID, status=400)
block = get_block_for_descriptor(
request.user, request, block_descriptor, field_data_cache, course.id, course=course
request.user, request, descriptor, field_data_cache, course.id, course=course
)

if modification_date:
Expand Down

0 comments on commit c452fb3

Please sign in to comment.