Skip to content

Commit

Permalink
Merge pull request #62 from edx/mroytman/MST-1130-additional-logs
Browse files Browse the repository at this point in the history
[MST-1130] Add Additional IDV Signal and Celery Task Logs
  • Loading branch information
MichaelRoytman authored Oct 26, 2021
2 parents f40bab8 + afe50b5 commit 0c72684
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ Change Log
Unreleased
~~~~~~~~~~

[1.0.3] - 2021-10-26
~~~~~~~~~~~~~~~~~~~~~
* Add system check to CI.
* Add additional logs to IDV signal handler and Celery task logic.

[1.0.2] - 2021-09-29
~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion edx_name_affirmation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Django app housing name affirmation logic.
"""

__version__ = '1.0.2'
__version__ = '1.0.3'

default_app_config = 'edx_name_affirmation.apps.EdxNameAffirmationConfig' # pylint: disable=invalid-name
16 changes: 16 additions & 0 deletions edx_name_affirmation/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,23 @@ def idv_attempt_handler(attempt_id, user_id, status, photo_id_name, full_name, *
photo_id_name(str): name to be used as verified name
full_name(str): user's pending name change or current profile name
"""
log.info('VerifiedName: idv_attempt_handler started for user %(user_id)s '
'with photo_id_name %(photo_id_name)s and status %(status)s',
{
'user_id': user_id,
'photo_id_name': photo_id_name,
'status': status
}
)
if is_verified_name_enabled():
log.info('VerifiedName: idv_attempt_handler triggering Celery task for user %(user_id)s '
'with photo_id_name %(photo_id_name)s and status %(status)s',
{
'user_id': user_id,
'photo_id_name': photo_id_name,
'status': status
}
)
idv_update_verified_name.delay(attempt_id, user_id, status, photo_id_name, full_name)


Expand Down
8 changes: 8 additions & 0 deletions edx_name_affirmation/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ def idv_update_verified_name(self, attempt_id, user_id, status, photo_id_name, f
"""
Celery task for updating a verified name based on an IDV attempt
"""
log.info('VerifiedName: idv_update_verified_name triggering Celery task started for user %(user_id)s '
'with attempt_id %(attempt_id)s and status %(status)s',
{
'user_id': user_id,
'attempt_id': attempt_id,
'status': status
}
)
trigger_status = VerifiedNameStatus.trigger_state_change_from_idv(status)
verified_names = VerifiedName.objects.filter(user__id=user_id, verified_name=photo_id_name).order_by('-created')
if verified_names:
Expand Down

0 comments on commit 0c72684

Please sign in to comment.