Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow verified name to be created if user is trying to verify with the same name #93

Merged
merged 1 commit into from
May 18, 2022

Conversation

alangsto
Copy link
Member

@alangsto alangsto commented May 17, 2022

Description:

Currently if a user tries to submit an IDV attempt with the same name as a previous IDV attempt that was reviewed, no verified name record will be created for them.

Splunk logs will show that in this case, it looks like a verified name is actually created for the learner, even though no record is actually created.

JIRA:

MST-1514

Pre-Merge Checklist:

  • Updated the version number in edx_name_affirmation/__init__.py if these changes are to be released. See OEP-47: Semantic Versioning.
  • Described your changes in CHANGELOG.rst.
  • Confirmed Github reports all automated tests/checks are passing.
  • Approved by at least one additional reviewer.

Post-Merge:

  • Create a tag matching the new version number.

@@ -37,7 +38,7 @@ def idv_update_verified_name_task(self, attempt_id, user_id, name_affirmation_st
'status': name_affirmation_status
}
)
verified_names = VerifiedName.objects.filter(user__id=user_id, verified_name=photo_id_name).order_by('-created')
verified_names = VerifiedName.objects.filter((Q(verification_attempt_id = attempt_id) | Q(verification_attempt_id__isnull = True)) & Q(user__id = user_id) & Q(verified_name = photo_id_name)).order_by('-created')
Copy link
Member Author

@alangsto alangsto May 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to try and update all verified name objects that match the user id and verified name, only the ones that either a) are not associated with any IDV attempt yet or b) are associated with the IDV attempt we got an update for.

@alangsto alangsto force-pushed the alangsto/fix_status_update branch 3 times, most recently from 12274fc to 85cd53e Compare May 17, 2022 19:57
@@ -37,7 +38,11 @@ def idv_update_verified_name_task(self, attempt_id, user_id, name_affirmation_st
'status': name_affirmation_status
}
)
verified_names = VerifiedName.objects.filter(user__id=user_id, verified_name=photo_id_name).order_by('-created')
verified_names = VerifiedName.objects.filter(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#NIT add a comment here to explain that when multiple VerifiedName records exists, there might be records we want to update that is not the latest created.

Copy link
Member

@schenedx schenedx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thank you for fixing the bug.

@alangsto alangsto force-pushed the alangsto/fix_status_update branch from 85cd53e to 1ce8c9a Compare May 18, 2022 12:43
@alangsto alangsto merged commit 430113b into main May 18, 2022
@alangsto alangsto deleted the alangsto/fix_status_update branch May 18, 2022 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants