Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cms/djangoapps/contentstore/views/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,17 @@ def _prepare_runtime_for_preview(request, block):
# See the docstring of `DjangoXBlockUserService`.
deprecated_anonymous_user_id = anonymous_id_for_user(request.user, None)

# NOTE: As of Ulmo, these services only apply to the preview views. If you want a service to be present in all
# Studio ModuleStoreRuntimes, then add it to load_services_for_studio.
# HISTORICAL CONTEXT: Until Ulmo, the `block.runtime._services.update(service)` call below would
# actually update the services dictionary for all runtimes, as `_services` was aliased between them.
# This caused a grading bug, under certain conditions, so it was fixed
# in https://github.com/openedx/openedx-platform/pull/37825; now, every runtime gets a fresh,
# independent copy of `_services`. That's good, except that some Studio code had become dependent
# on the bugged behavior and thus expected the "preview" services below to be present in all Studio runtimes.
# We fixed the known instance of that bugged assumption here:
# https://github.com/openedx/openedx-platform/pull/37900.
# This comment is left here as a note for future devs investigating similar bugs.
services = {
"studio_user_permissions": StudioPermissionsService(request.user),
"i18n": XBlockI18nService,
Expand Down
Loading