Skip to content

Commit

Permalink
chore: change condition logic
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-canon committed Aug 6, 2024
1 parent 83f7bdc commit eb1d459
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions eox_nelp/signals/receivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,23 +395,25 @@ def pearson_vue_course_completion_handler(instance, **kwargs): # pylint: disabl

is_complete, graded = get_completed_and_graded(user_id=instance.user_id, course_id=str(instance.context_key))

if is_complete and not graded:
LOGGER.info(
"Initializing rti task for the user %s, action triggered by course completion status",
instance.user_id,
)
if graded and not is_complete:
return

if getattr(settings, "USE_PEARSON_ENGINE_SERVICE", False):
real_time_import_task_v2.delay(
user_id=instance.user_id,
exam_id=str(instance.context_key),
action_name="rti",
)
else:
real_time_import_task.delay(
user_id=instance.user_id,
course_id=str(instance.context_key),
)
LOGGER.info(
"Initializing rti task for the user %s, action triggered by course completion status",
instance.user_id,
)

if getattr(settings, "USE_PEARSON_ENGINE_SERVICE", False):
real_time_import_task_v2.delay(
user_id=instance.user_id,
exam_id=str(instance.context_key),
action_name="rti",
)
else:
real_time_import_task.delay(
user_id=instance.user_id,
course_id=str(instance.context_key),
)


def pearson_vue_course_passed_handler(user, course_id, **kwargs): # pylint: disable=unused-argument
Expand Down

0 comments on commit eb1d459

Please sign in to comment.