Skip to content

Commit

Permalink
fix: handle review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
syedsajjadkazmii committed Dec 3, 2024
1 parent 2d483fe commit 2692fde
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions commerce_coordinator/apps/lms/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""

import json

from datetime import datetime

from celery import Task, shared_task
Expand Down Expand Up @@ -45,9 +44,13 @@ def on_failure(self, exc, task_id, args, kwargs, einfo):
f"Order Number: {order_number}, Course Title: {course_title}"
)

# This error is returned from LMS if the course mode is unsupported
# https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/enrollments/views.py#L870
course_mode_expired_error = "course mode is expired or otherwise unavailable for course run"

if (
self.request.retries >= self.max_retries
and "course mode is expired or otherwise unavailable for course run" in error_message
and course_mode_expired_error in error_message
):

logger.info(
Expand Down

0 comments on commit 2692fde

Please sign in to comment.