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

Add new management command to approve submitted ID verification attempts. #34340

Merged

Conversation

MichaelRoytman
Copy link
Contributor

@MichaelRoytman MichaelRoytman commented Mar 7, 2024

Description

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).

Supporting information

Jira: COSMO-210 (private)

Testing instructions

  1. Create an instance of the SoftwareSecurePhotoVerification model in the submitted state. A good way to do this is via the Verified Name feature in the Account MFE.
  2. Create a text file with the user IDs of the users whose IDV attempts you want to approve; one ID per line.
  3. Run manage.py lms approve_id_verifications <path_to_file>.

Deadline

None.

Other information

None.

@MichaelRoytman MichaelRoytman force-pushed the mroytman/COSMO-210-idv-approval-management-command branch from 94376e5 to a5a0e01 Compare March 7, 2024 17:29
help = 'Manually approves ID verifications for users with an ID verification attempt in the submitted state.'

def add_arguments(self, parser):
parser.add_argument(
Copy link
Contributor Author

@MichaelRoytman MichaelRoytman Mar 7, 2024

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(
Copy link
Contributor Author

@MichaelRoytman MichaelRoytman Mar 7, 2024

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.

@MichaelRoytman MichaelRoytman force-pushed the mroytman/COSMO-210-idv-approval-management-command branch from a5a0e01 to c8e3a46 Compare March 7, 2024 18:40
Copy link
Contributor

@alangsto alangsto left a 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!

Copy link
Contributor

@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.

Just a minor question. Rest LGTM

@MichaelRoytman MichaelRoytman force-pushed the mroytman/COSMO-210-idv-approval-management-command branch from c8e3a46 to 75d9a0e Compare March 8, 2024 17:15
… 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).
@MichaelRoytman MichaelRoytman force-pushed the mroytman/COSMO-210-idv-approval-management-command branch from 75d9a0e to 56719e9 Compare March 8, 2024 17:37
Copy link
Contributor

@alangsto alangsto left a comment

Choose a reason for hiding this comment

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

LGTM!

@MichaelRoytman MichaelRoytman merged commit 4a2e0f7 into master Mar 8, 2024
47 checks passed
@MichaelRoytman MichaelRoytman deleted the mroytman/COSMO-210-idv-approval-management-command branch March 8, 2024 18:39
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

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.

4 participants