openedx / xblock-image-explorer

GNU Affero General Public License v3.0
9 stars 39 forks source link

fix: update static_replace import to work with lilac. #92

Open johanseto opened 2 years ago

johanseto commented 2 years ago

Description

This PR makes a little fix to the xblock in order to be used in lilac versions.

Change the static_replace import for lilac in image_explorer.py in order to be updated with lilac version imports and avoid DeprecatedEdxPlatformImportError.

error:

cms_1            |   File "/openedx/venv/lib/python3.8/site-packages/image_explorer/image_explorer.py", line 215, in student_view_data
cms_1            |     background['src'] = self._replace_static_from_url(background['src'])
cms_1            |   File "/openedx/venv/lib/python3.8/site-packages/image_explorer/image_explorer.py", line 336, in _replace_static_from_url
cms_1            |     from static_replace import replace_static_urls
cms_1            |   File "/openedx/edx-platform/import_shims/lms/static_replace/__init__.py", line 6, in <module>
cms_1            |     warn_deprecated_import('static_replace', 'common.djangoapps.static_replace')
cms_1            |   File "/openedx/edx-platform/import_shims/warn.py", line 37, in warn_deprecated_import
cms_1            |     raise DeprecatedEdxPlatformImportError(old_import, new_import)
cms_1            | import_shims.warn.DeprecatedEdxPlatformImportError
johanseto commented 2 years ago

Hi actually this PR is failing one test, but if you see the error it is not a thing I can control: https://app.circleci.com/pipelines/github/edx-solutions/xblock-image-explorer/155/workflows/cc54e07d-3ea9-4322-ad01-030b81a8744a/jobs/315?invite=true#step-103-133.

Besides this PR make a very small change.