refactor: we don't need _unwrapped_field_data any more

This commit is contained in:
Braden MacDonald
2023-05-29 14:47:21 -07:00
parent 6dd9d2e068
commit dac1c5abe1
3 changed files with 11 additions and 17 deletions

View File

@@ -170,6 +170,12 @@ class CachingDescriptorSystem(MakoDescriptorSystem, EditInfoRuntimeMixin): # li
A system that has a cache of block json that it will use to load blocks
from, with a backup of calling to the underlying modulestore for more data
"""
# This CachingDescriptorSystem runtime sets block._field_data on each block via construct_xblock_from_class(),
# rather than the newer approach of providing a "field-data" service via runtime.service(). As a result, during
# bind_for_student() we can't just set ._bound_field_data; we must overwrite block._field_data.
uses_deprecated_field_data = True
def __repr__(self):
return "CachingDescriptorSystem{!r}".format((
self.modulestore,
@@ -177,11 +183,6 @@ class CachingDescriptorSystem(MakoDescriptorSystem, EditInfoRuntimeMixin): # li
[str(key) for key in self.module_data.keys()],
self.default_class,
))
# This CachingDescriptorSystem runtime sets block._field_data on each block via construct_xblock_from_class(),
# rather than the newer approach of providing a "field-data" service via runtime.service(). As a result, during
# bind_for_student() we can't just set ._bound_field_data; we must overwrite block._field_data.
uses_deprecated_field_data = True
def __init__(self, modulestore, course_key, module_data, default_class, **kwargs):
"""

View File

@@ -429,13 +429,6 @@ class XModuleMixin(XModuleFields, XBlock):
self.save()
return self._field_data._kvs # pylint: disable=protected-access
def _unwrapped_field_data(self):
"""
This property gets the field-data service before we wrap it in user-specifc wrappers during bind_for_student,
e.g. the LmsFieldData or OverrideFieldData classes.
"""
return self.runtime.service(self, 'field-data-unbound')
def add_aside(self, aside):
"""
save connected asides