Skip to content

Commit

Permalink
fix: use full import path to safe_lxml (v0.19.0)
Browse files Browse the repository at this point in the history
Previously, edx-platform's safe_lxml module was imported as:

  import safe_lxml

This still works, but will stop working very soon.

This commit updates edx-sga's usage of safe_lxml to the new,
correct import path:

  import openedx.core.lib.safe_lxml

(Details & reasoning behind this import path change:
  * https://discuss.openedx.org/t/breaking-apart-edx-platforms-common-lib-folder/7556
  * https://openedx.atlassian.net/browse/BOM-2579)

This change is NOT backwards-compatible with Nutmeg or earlier.
Bumps edx-sga version to 0.19.0.
  • Loading branch information
kdmccormick committed Jul 7, 2022
1 parent 5182fcf commit afd68c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion edx_sga/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Module for StaffGradedAssignmentXBlock.
"""

__version__ = "0.18.0"
__version__ = "0.19.0"
2 changes: 1 addition & 1 deletion edx_sga/sga.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from django.utils.timezone import now as django_now
from django.utils.translation import gettext as _
from lms.djangoapps.courseware.models import StudentModule
from safe_lxml import etree
from openedx.core.lib.safe_lxml import etree
from common.djangoapps.student.models import user_by_anonymous_id
from submissions import api as submissions_api
from submissions.models import StudentItem as SubmissionsStudent
Expand Down
2 changes: 1 addition & 1 deletion edx_sga/tests/test_sga.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def fake_import(name, *args, **kwargs):
for module in ("common", "courseware", "lms", "xmodule"):
if name.startswith(f"{module}.") or name == module:
return mock.Mock()
if name == "safe_lxml":
if name == "openedx.core.lib.safe_lxml":
return real_import("lxml", *args, **kwargs)
raise

Expand Down

0 comments on commit afd68c4

Please sign in to comment.