From a0d23b20f5eecf97c0d0ea2e03125297e6fff13c Mon Sep 17 00:00:00 2001 From: Pooja Kulkarni Date: Wed, 4 Jan 2023 13:57:25 -0500 Subject: [PATCH] refactor: rename descriptor -> block within lms/djangoapps/course_api Co-authored-by: Agrendalath --- lms/djangoapps/course_api/blocks/transformers/student_view.py | 2 +- lms/djangoapps/course_api/tests/test_serializers.py | 4 ++-- lms/djangoapps/course_home_api/progress/views.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lms/djangoapps/course_api/blocks/transformers/student_view.py b/lms/djangoapps/course_api/blocks/transformers/student_view.py index 997b69dafc..b677bd66f5 100644 --- a/lms/djangoapps/course_api/blocks/transformers/student_view.py +++ b/lms/djangoapps/course_api/blocks/transformers/student_view.py @@ -33,7 +33,7 @@ class StudentViewTransformer(BlockStructureTransformer): for block_key in block_structure.topological_traversal(): block = block_structure.get_xblock(block_key) - # We're iterating through descriptors (not bound to a user) that are + # We're iterating through blocks (not bound to a user) that are # given to us by the modulestore. The reason we look at # block.__class__ is to avoid the XModuleDescriptor -> XModule # proxying that would happen if we just examined block directly, diff --git a/lms/djangoapps/course_api/tests/test_serializers.py b/lms/djangoapps/course_api/tests/test_serializers.py index 4ee5e10265..60971df577 100644 --- a/lms/djangoapps/course_api/tests/test_serializers.py +++ b/lms/djangoapps/course_api/tests/test_serializers.py @@ -163,8 +163,8 @@ class TestCourseDetailSerializer(TestCourseSerializer): # lint-amnesty, pylint: super().setUp() # update the expected_data to include the 'overview' data. - about_descriptor = XBlock.load_class('about') - overview_template = about_descriptor.get_template('overview.yaml') + about_block = XBlock.load_class('about') + overview_template = about_block.get_template('overview.yaml') self.expected_data['overview'] = overview_template.get('data') # override test case diff --git a/lms/djangoapps/course_home_api/progress/views.py b/lms/djangoapps/course_home_api/progress/views.py index dc0ea63525..fd96ff6c08 100644 --- a/lms/djangoapps/course_home_api/progress/views.py +++ b/lms/djangoapps/course_home_api/progress/views.py @@ -226,8 +226,8 @@ class ProgressTabView(RetrieveAPIView): user_grade = course_grade.percent user_has_passing_grade = user_grade >= course.lowest_passing_grade - descriptor = modulestore().get_course(course_key) - grading_policy = descriptor.grading_policy + block = modulestore().get_course(course_key) + grading_policy = block.grading_policy verification_status = IDVerificationService.user_status(student) verification_link = None if verification_status['status'] is None or verification_status['status'] == 'expired':