-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
edx_name_affirmation/tasks.py
Outdated
@@ -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') |
There was a problem hiding this comment.
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.
12274fc
to
85cd53e
Compare
@@ -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( |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
85cd53e
to
1ce8c9a
Compare
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:
edx_name_affirmation/__init__.py
if these changes are to be released. See OEP-47: Semantic Versioning.CHANGELOG.rst
.Post-Merge: