-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Add new management command to approve submitted ID verification attempts. #34340
Add new management command to approve submitted ID verification attempts. #34340
Conversation
94376e5
to
a5a0e01
Compare
help = 'Manually approves ID verifications for users with an ID verification attempt in the submitted state.' | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument( |
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.
I changed this to take a file of user IDs instead of emails to limit PII exposure. I also made it required, because I don't see us needing to call this command with a singular user ID (and creating a file with one user ID is trivial).
failed_user_ids: list of user IDs for which a manual approval was not performed | ||
""" | ||
users = User.objects.filter(id__in=user_ids) | ||
existing_id_verifications = SoftwareSecurePhotoVerification.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.
A user may have more than one SoftwareSecurePhotoVerification
attempt, although it should be rare, because you're only allowed to have one pending name change at a time, if you're using the Name Affirmation feature. I believe it's safe to approve them all.
a5a0e01
to
c8e3a46
Compare
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.
Left one question, but otherwise this looks good!
lms/djangoapps/verify_student/management/commands/approve_id_verifications.py
Show resolved
Hide resolved
lms/djangoapps/verify_student/management/commands/approve_id_verifications.py
Outdated
Show resolved
Hide resolved
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.
Just a minor question. Rest LGTM
c8e3a46
to
75d9a0e
Compare
… attempts This pull requests adds a new management command approve_id_verifications to manually approve submitted ID verification attempts (i.e. instances of the SoftwareSecurePhotoVerifications model).
75d9a0e
to
56719e9
Compare
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.
LGTM!
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
2U Release Notice: This PR has been deployed to the edX production environment. |
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
Description
This pull requests adds a new management command
approve_id_verifications
to manually approve submitted ID verification attempts (i.e. instances of theSoftwareSecurePhotoVerifications model
).Supporting information
Jira: COSMO-210 (private)
Testing instructions
SoftwareSecurePhotoVerification
model in thesubmitted
state. A good way to do this is via the Verified Name feature in the Account MFE.manage.py lms approve_id_verifications <path_to_file>
.Deadline
None.
Other information
None.