fix: add logging message to debug the idv celery trigger logic (#29113)

We suspect the IDV code do not trigger name_affirmation update celery task correctly. Add the logging in code so we can trace the order of operation and figure out what is missing

Co-authored-by: Simon Chen <schen@edx-c02fw0guml85.lan>
This commit is contained in:
Simon Chen
2021-10-26 11:48:47 -04:00
committed by GitHub
parent f1957a7cf7
commit 817a4d5b1d

View File

@@ -1,19 +1,21 @@
"""
Signal handler for setting default course verification dates
"""
import logging
from django.db.models.signals import post_save
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_save
from django.dispatch import Signal
from django.dispatch.dispatcher import receiver
from xmodule.modulestore.django import SignalHandler, modulestore
from common.djangoapps.student.models_api import get_name, get_pending_name_change
from openedx.core.djangoapps.user_api.accounts.signals import USER_RETIRE_LMS_CRITICAL
from xmodule.modulestore.django import SignalHandler, modulestore
from .models import SoftwareSecurePhotoVerification, VerificationDeadline
log = logging.getLogger(__name__)
# Signal for emitting IDV submission and review updates
idv_update_signal = Signal(providing_args=["attempt_id", "user_id", "status", "full_name", "profile_name"])
@@ -52,6 +54,14 @@ def send_idv_update(sender, instance, **kwargs): # pylint: disable=unused-argum
# Prioritize pending name change over current profile name, if the user has one
full_name = get_pending_name_change(instance.user) or get_name(instance.user.id)
log.info(
'IDV sending name_affirmation task (idv_id={idv_id}, user_id={user_id}) to update status={status}'.format(
user_id=instance.user.id,
status=instance.status,
idv_id=instance.id
)
)
idv_update_signal.send(
sender='idv_update',
attempt_id=instance.id,