refactor: deprecate course_id from ModuleSystem

This attribute is already deprecated for XBlocks in favour of directly
retrieving it like `block.scope_ids.usage_id.context_key`.

This commit also removes some redundant logging code which was omitted in the
Datadog removal in #19420.
This commit is contained in:
Agrendalath
2022-07-07 22:07:04 +02:00
parent c2ac3d83c3
commit dd97c74fde
11 changed files with 44 additions and 64 deletions

View File

@@ -211,7 +211,6 @@ def _preview_module_system(request, descriptor, field_data):
track_function=lambda event_type, event: None,
get_module=partial(_load_preview_module, request),
mixins=settings.XBLOCK_MIXINS,
course_id=course_id,
# Set up functions to modify the fragment produced by student_view
wrappers=wrappers,

View File

@@ -296,7 +296,7 @@ class CmsModuleSystemShimTest(ModuleStoreTestCase):
def test_replace_urls(self):
html = '<a href="/static/id">'
assert self.runtime.replace_urls(html) == \
static_replace.replace_static_urls(html, course_id=self.runtime.course_id)
static_replace.replace_static_urls(html, course_id=self.course.id)
def test_anonymous_user_id_preview(self):
assert self.runtime.anonymous_student_id == 'student'