diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index c65e00a0f36a..75ad7753298e 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -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( @@ -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 }, ) diff --git a/requirements/edx/base.in b/requirements/edx/base.in index 7075a130e238..92fe2e03188d 100644 --- a/requirements/edx/base.in +++ b/requirements/edx/base.in @@ -185,7 +185,8 @@ unicodecsv # Easier support for CSV files with unicode user-util # Functionality for retiring users (GDPR compliance) webob web-fragments # Provides the ability to render fragments of web pages -XBlock[django] # Courseware component architecture +# Using OpenCraft fork of XBlock in github.in +#XBlock[django] # Courseware component architecture xblock-utils # Provides utilities used by the Discussion XBlock xss-utils # https://github.com/edx/edx-platform/pull/20633 Fix XSS via Translations xblock-poll # Xblock for polling users diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 627bc531bc0f..6e9f254c9699 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -762,8 +762,10 @@ openedx-blockstore==1.3.1 # via -r requirements/edx/base.in openedx-calc==3.0.1 # via -r requirements/edx/base.in -openedx-django-pyfs==3.2.1 - # via xblock +openedx-django-pyfs @ git+https://github.com/open-craft/django-pyfs.git@opencraft-release/3.5.0-tox-3 + # via + # -r requirements/edx/github.in + # xblock openedx-django-require==2.0.0 # via -r requirements/edx/base.in openedx-django-wiki==2.0.0 @@ -1170,9 +1172,9 @@ wrapt==1.15.0 # via # -r requirements/edx/paver.txt # deprecated -xblock[django]==1.6.2 +xblock @ git+https://github.com/open-craft/XBlock.git@opencraft-release/1.6.2 # via - # -r requirements/edx/base.in + # -r requirements/edx/github.in # acid-xblock # crowdsourcehinter-xblock # done-xblock diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index f95cbf2faed8..636002b721b3 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -575,7 +575,7 @@ edx-django-release-util==1.2.0 # openedx-blockstore edx-django-sites-extensions==4.0.0 # via -r requirements/edx/testing.txt -edx-django-utils==5.2.0 +edx-django-utils==5.3.0 # via # -r requirements/edx/testing.txt # django-config-models @@ -890,7 +890,6 @@ lazy==1.5 # bok-choy # lti-consumer-xblock # ora2 - # xblock lazy-object-proxy==1.9.0 # via # -r requirements/edx/testing.txt @@ -1019,10 +1018,8 @@ openedx-blockstore==1.3.1 # via -r requirements/edx/testing.txt openedx-calc==3.0.1 # via -r requirements/edx/testing.txt -openedx-django-pyfs==3.2.1 - # via - # -r requirements/edx/testing.txt - # xblock +openedx-django-pyfs @ git+https://github.com/open-craft/django-pyfs.git@opencraft-release/3.5.0-tox-3 + # via -r requirements/edx/testing.txt openedx-django-require==2.0.0 # via -r requirements/edx/testing.txt openedx-django-wiki==2.0.0 @@ -1699,7 +1696,7 @@ wrapt==1.15.0 # -r requirements/edx/testing.txt # astroid # deprecated -xblock[django]==1.6.2 +xblock @ git+https://github.com/open-craft/XBlock.git@opencraft-release/1.6.2 # via # -r requirements/edx/testing.txt # acid-xblock diff --git a/requirements/edx/github.in b/requirements/edx/github.in index 77fb59beaffe..1504c1e1d472 100644 --- a/requirements/edx/github.in +++ b/requirements/edx/github.in @@ -85,7 +85,10 @@ # Critical fixes for packages that are not yet available in a PyPI release. ############################################################################## -# ... add dependencies here +# https://github.com/open-craft/XBlock/pull/6 +git+https://github.com/open-craft/XBlock.git@opencraft-release/1.6.2#egg=XBlock[django]==1.6.2 +# https://github.com/openedx/django-pyfs/pull/169 +git+https://github.com/open-craft/django-pyfs.git@opencraft-release/3.5.0-tox-3#egg=openedx-django-pyfs==3.5.0 ############################################################################## diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index cd6d564d51e5..faddcd49c363 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -553,7 +553,7 @@ edx-django-release-util==1.2.0 # openedx-blockstore edx-django-sites-extensions==4.0.0 # via -r requirements/edx/base.txt -edx-django-utils==5.2.0 +edx-django-utils==5.3.0 # via # -r requirements/edx/base.txt # django-config-models @@ -846,7 +846,6 @@ lazy==1.5 # bok-choy # lti-consumer-xblock # ora2 - # xblock lazy-object-proxy==1.9.0 # via astroid learner-pathway-progress==1.3.3 @@ -966,10 +965,8 @@ openedx-blockstore==1.3.1 # via -r requirements/edx/base.txt openedx-calc==3.0.1 # via -r requirements/edx/base.txt -openedx-django-pyfs==3.2.1 - # via - # -r requirements/edx/base.txt - # xblock +openedx-django-pyfs @ git+https://github.com/open-craft/django-pyfs.git@opencraft-release/3.5.0-tox-3 + # via -r requirements/edx/base.txt openedx-django-require==2.0.0 # via -r requirements/edx/base.txt openedx-django-wiki==2.0.0 @@ -1567,7 +1564,7 @@ wrapt==1.15.0 # -r requirements/edx/base.txt # astroid # deprecated -xblock[django]==1.6.2 +xblock @ git+https://github.com/open-craft/XBlock.git@opencraft-release/1.6.2 # via # -r requirements/edx/base.txt # acid-xblock