Skip to content

Commit

Permalink
fix: renamed DatabaseNotReadyError (#35390)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anas12091101 committed Aug 29, 2024
1 parent 1a431b6 commit 5323c55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lms/djangoapps/grades/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"""


class DatabaseNotReadyError(IOError):
class ScoreNotFoundError(IOError):
"""
Subclass of IOError to indicate the database has not yet committed
the data we're trying to find.
Subclass of IOError to indicate the staff has not yet graded the problem or
the database has not yet committed the data we're trying to find.
"""
pass # lint-amnesty, pylint: disable=unnecessary-pass
6 changes: 3 additions & 3 deletions lms/djangoapps/grades/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from .config.waffle import DISABLE_REGRADE_ON_POLICY_CHANGE
from .constants import ScoreDatabaseTableEnum
from .course_grade_factory import CourseGradeFactory
from .exceptions import DatabaseNotReadyError
from .exceptions import ScoreNotFoundError
from .grade_utils import are_grades_frozen
from .signals.signals import SUBSECTION_SCORE_CHANGED
from .subsection_grade_factory import SubsectionGradeFactory
Expand All @@ -45,7 +45,7 @@
KNOWN_RETRY_ERRORS = ( # Errors we expect occasionally, should be resolved on retry
DatabaseError,
ValidationError,
DatabaseNotReadyError,
ScoreNotFoundError,
UsageKeyNotInBlockStructure,
)
RECALCULATE_GRADE_DELAY_SECONDS = 2 # to prevent excessive _has_db_updated failures. See TNL-6424.
Expand Down Expand Up @@ -239,7 +239,7 @@ def _recalculate_subsection_grade(self, **kwargs):
has_database_updated = _has_db_updated_with_new_score(self, scored_block_usage_key, **kwargs)

if not has_database_updated:
raise DatabaseNotReadyError
raise ScoreNotFoundError

_update_subsection_grades(
course_key,
Expand Down

0 comments on commit 5323c55

Please sign in to comment.