Skip to content

Commit

Permalink
fix: make "fs" service available in XBlock preview module system (i.e…
Browse files Browse the repository at this point in the history
…. in Studio)
  • Loading branch information
ArturGaspar committed Dec 6, 2023
1 parent 1c6d7b2 commit b4d0c91
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cms/djangoapps/contentstore/views/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,16 @@ def _preview_module_system(request, descriptor, field_data):
descriptor: An XModuleDescriptor
"""

# Import is placed here to avoid model import at project startup.
import xblock.reference.plugins

course_id = descriptor.location.course_key
display_name_only = (descriptor.category == 'static_tab')

replace_url_service = ReplaceURLService(course_id=course_id)

fs_service = xblock.reference.plugins.FSService()

wrappers = [
# This wrapper wraps the block in the template specified above
partial(
Expand Down Expand Up @@ -229,7 +234,8 @@ def _preview_module_system(request, descriptor, field_data):
"teams_configuration": TeamsConfigurationService(),
"sandbox": SandboxService(contentstore=contentstore, course_id=course_id),
"cache": CacheService(cache),
'replace_urls': replace_url_service
'replace_urls': replace_url_service,
"fs": fs_service
},
)

Expand Down

0 comments on commit b4d0c91

Please sign in to comment.