diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fd61cfb..b03a94f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,10 @@ Change Log Unreleased ~~~~~~~~~~ +[1.0.1] - 2021-09-28 +~~~~~~~~~~~~~~~~~~~~~ +* Move toggle check out of tasks + [1.0.0] - 2021-09-23 ~~~~~~~~~~~~~~~~~~~~~ * Move signal receiver logic into celery task diff --git a/edx_name_affirmation/__init__.py b/edx_name_affirmation/__init__.py index 87a95b3..bf3ca02 100644 --- a/edx_name_affirmation/__init__.py +++ b/edx_name_affirmation/__init__.py @@ -2,6 +2,6 @@ Django app housing name affirmation logic. """ -__version__ = '1.0.0' +__version__ = '1.0.1' default_app_config = 'edx_name_affirmation.apps.EdxNameAffirmationConfig' # pylint: disable=invalid-name diff --git a/edx_name_affirmation/handlers.py b/edx_name_affirmation/handlers.py index 61b56b6..3d57faa 100644 --- a/edx_name_affirmation/handlers.py +++ b/edx_name_affirmation/handlers.py @@ -12,6 +12,7 @@ from edx_name_affirmation.signals import VERIFIED_NAME_APPROVED from edx_name_affirmation.statuses import VerifiedNameStatus from edx_name_affirmation.tasks import idv_update_verified_name, proctoring_update_verified_name +from edx_name_affirmation.toggles import is_verified_name_enabled User = get_user_model() @@ -42,7 +43,8 @@ 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 """ - idv_update_verified_name.delay(attempt_id, user_id, status, photo_id_name, full_name) + if is_verified_name_enabled(): + idv_update_verified_name.delay(attempt_id, user_id, status, photo_id_name, full_name) def proctoring_attempt_handler( @@ -69,13 +71,14 @@ def proctoring_attempt_handler( is_proctored(boolean): if the exam attempt is for a proctored exam backend_supports_onboarding(boolean): if the exam attempt is for an exam with a backend that supports onboarding """ - proctoring_update_verified_name.delay( - attempt_id, - user_id, - status, - full_name, - profile_name, - is_practice_exam, - is_proctored, - backend_supports_onboarding - ) + if is_verified_name_enabled(): + proctoring_update_verified_name.delay( + attempt_id, + user_id, + status, + full_name, + profile_name, + is_practice_exam, + is_proctored, + backend_supports_onboarding + ) diff --git a/edx_name_affirmation/tasks.py b/edx_name_affirmation/tasks.py index 705a23a..6b67163 100644 --- a/edx_name_affirmation/tasks.py +++ b/edx_name_affirmation/tasks.py @@ -12,7 +12,6 @@ from edx_name_affirmation.models import VerifiedName from edx_name_affirmation.statuses import VerifiedNameStatus -from edx_name_affirmation.toggles import is_verified_name_enabled User = get_user_model() @@ -25,8 +24,6 @@ def idv_update_verified_name(attempt_id, user_id, status, photo_id_name, full_na """ Celery task for updating a verified name based on an IDV attempt """ - if not is_verified_name_enabled(): - return 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') @@ -102,8 +99,6 @@ def proctoring_update_verified_name( """ Celery task for updating a verified name based on a proctoring attempt """ - if not is_verified_name_enabled(): - return # We only care about updates from onboarding exams, or from non-practice proctored exams with a backend that # does not support onboarding. This is because those two event types are guaranteed to contain verification events,