Skip to content

Commit

Permalink
fix: circular imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Cup0fCoffee committed Dec 28, 2024
1 parent 121f9b9 commit bf6bc9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lms/djangoapps/grades/subsection_grade.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from lms.djangoapps.grades.scores import compute_percent, get_score, possibly_scored
from xmodule import block_metadata_utils, graders # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.graders import AggregatedScore # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.services import ProblemFeedbackService

log = getLogger(__name__)

Expand Down Expand Up @@ -61,6 +60,10 @@ def show_grades(self, has_staff_access):
"""
Returns whether subsection scores are currently available to users with or without staff access.
"""
# NOTE: Importing here to avoid circular imports between `grades.api`
# and `xmodule.services`.
from xmodule.services import ProblemFeedbackService

return ProblemFeedbackService(block=self._block, user_is_staff=has_staff_access).correctness_available()

@property
Expand Down
2 changes: 1 addition & 1 deletion xmodule/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from lms.djangoapps.lms_xblock.field_data import LmsFieldData
from lms.djangoapps.lms_xblock.models import XBlockAsidesConfig

from lms.djangoapps.grades.signals import signals as grades_signals
from lms.djangoapps.grades.api import signals as grades_signals

log = logging.getLogger(__name__)

Expand Down

0 comments on commit bf6bc9e

Please sign in to comment.