feat: remove field data binding from the runtime

This commit is contained in:
Agrendalath
2023-06-02 17:16:20 +02:00
parent 8072c3e9ef
commit 5f46ea52cd
6 changed files with 17 additions and 29 deletions

View File

@@ -433,9 +433,6 @@ def prepare_runtime_for_user(
Arguments:
see arguments for get_block()
request_token (str): A token unique to the request use by xblock initialization
Returns:
KvsFieldData: student_data bound to, primarily, the user and block
"""
def inner_get_block(block):
@@ -524,14 +521,11 @@ def prepare_runtime_for_user(
if staff_access:
block_wrappers.append(partial(add_staff_markup, user, disable_staff_debug_info))
field_data = DateLookupFieldData(block._field_data, course_id, user) # pylint: disable=protected-access
field_data = LmsFieldData(field_data, student_data)
store = modulestore()
services = {
'fs': FSService(),
'field-data': field_data,
'field-data': student_data,
'mako': mako_service,
'user': DjangoXBlockUserService(
user,
@@ -601,8 +595,6 @@ def prepare_runtime_for_user(
block.runtime.set('position', position)
return field_data
# TODO: Find all the places that this method is called and figure out how to
# get a loaded course passed into it
@@ -619,7 +611,7 @@ def get_block_for_descriptor_internal(user, block, student_data, course_id, trac
request_token (str): A unique token for this request, used to isolate xblock rendering
"""
student_data = prepare_runtime_for_user(
prepare_runtime_for_user(
user=user,
student_data=student_data, # These have implicit user bindings, the rest of args are considered not to
block=block,
@@ -645,8 +637,6 @@ def get_block_for_descriptor_internal(user, block, student_data, course_id, trac
],
)
block.scope_ids = block.scope_ids._replace(user_id=user.id)
# Do not check access when it's a noauth request.
# Not that the access check needs to happen after the block is bound
# for the student, since there may be field override data for the student