lms.djangoapps.verify_student.management.commands package#
Submodules#
lms.djangoapps.verify_student.management.commands.approve_id_verifications module#
Django admin commands related to verify_student
- class lms.djangoapps.verify_student.management.commands.approve_id_verifications.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommandThis command manually approves ID verification attempts for a provided set of learners whose ID verification attempt is in the submitted or must_retry state.
This command differs from the similar manual_verifications command in that it approves the SoftwareSecurePhotoVerification instance instead of creating a ManualVerification instance. This is advantageous because it ensures that the approval is registered with the Name Affirmation application to approve corresponding verified names. Creating a ManualVerification instance does not effect any change in the Name Affirmation application.
- Example usage:
$ ./manage.py lms idv_verifications <absolute path of file with user IDs (one per line)>
- add_arguments(parser)#
Entry point for subclassed commands to add custom arguments.
- handle(*args, **options)#
The actual logic of the command. Subclasses must implement this method.
- help = 'Manually approve ID verifications for users with an attempt in the submitted or must_retry state.'#
lms.djangoapps.verify_student.management.commands.backfill_sso_verifications_for_old_account_links module#
Management command to backfill verification records for preexisting account links
Meant to facilitate the alteration of a particular third_party_auth_samlproviderconfig to flip on the enable_sso_id_verification bit, which would ordinarily leave any preexisting account links without the corresponding resultant ID verification record.
This also manually triggers the same signal which is sent on creation of SSO IDV records.
- class lms.djangoapps.verify_student.management.commands.backfill_sso_verifications_for_old_account_links.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommandManagement command to backfill verification records for preexisting account links
Meant to facilitate the alteration of a particular third_party_auth_samlproviderconfig to flip on the enable_sso_id_verification bit, which would ordinarily leave any preexisting account links without the corresponding resultant ID verification record.
- Example usage:
$ ./manage.py lms backfill_sso_verifications_for_old_account_links –provider-slug=saml-gatech
- add_arguments(parser)#
Entry point for subclassed commands to add custom arguments.
- filter_user_social_auth_queryset_by_ssoverification_existence(query_set)#
- handle(*args, **options)#
The actual logic of the command. Subclasses must implement this method.
- help = 'Backfills SSO verification records for the given SAML provider slug'#
lms.djangoapps.verify_student.management.commands.manual_verifications module#
Django admin commands related to verify_student
- class lms.djangoapps.verify_student.management.commands.manual_verifications.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommandThis method attempts to manually verify users. Example usage:
$ ./manage.py lms manual_verifications –email-ids-file <absolute path of file with email ids (one per line)>
- add_arguments(parser)#
Entry point for subclassed commands to add custom arguments.
- handle(*args, **options)#
The actual logic of the command. Subclasses must implement this method.
- help = 'Manually verifies one or more users passed as an argument list.'#
lms.djangoapps.verify_student.management.commands.retry_failed_photo_verifications module#
Django admin commands related to verify_student
- class lms.djangoapps.verify_student.management.commands.retry_failed_photo_verifications.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommandThis method finds those SoftwareSecurePhotoVerifications with a selected status from a start_datetime to an end_datetime and attempts to verify them.
Use case: Multiple IDVs need to be resubmitted.
Example
./manage.py lms retry_failed_photo_verifications –status=”submitted” –start_datetime=”2023-03-01 00:00:00” –end_datetime=”2023-03-28 23:59:59” (This resubmits all ‘submitted’ SoftwareSecurePhotoVerifications from 2023-03-01 to 2023-03-28)
- add_arguments(parser)#
Entry point for subclassed commands to add custom arguments.
- args = '<SoftwareSecurePhotoVerification id, SoftwareSecurePhotoVerification id, ...>'#
- get_args_from_database()#
Returns an options dictionary from the current SSPVerificationRetryConfig model.
- handle(*args, **options)#
The actual logic of the command. Subclasses must implement this method.
- help = 'Retries SoftwareSecurePhotoVerifications passed as arguments, or if no arguments are supplied, all that have a specified status, from a start datetime to an end datetime'#
lms.djangoapps.verify_student.management.commands.send_verification_expiry_email module#
Django admin command to send verification expiry email to learners
- class lms.djangoapps.verify_student.management.commands.send_verification_expiry_email.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommandThis command sends email to learners for which the Software Secure Photo Verification has expired
The expiry email is sent when the date represented by SoftwareSecurePhotoVerification’s field expiration_datetime lies within the date range provided by command arguments. If the email is already sent indicated by field expiry_email_date then filter if the specified number of days given in settings as VERIFICATION_EXPIRY_EMAIL[‘RESEND_DAYS’] have passed since the last email.
Since a user can have multiple verification all the previous verifications have expiry_email_date set to None so that they are not filtered. See lms/djangoapps/verify_student/views.py:1174
The range to filter expired verification is selected based on VERIFICATION_EXPIRY_EMAIL[‘DAYS_RANGE’]. This represents the number of days before now and gives us start_date of the range
Range: start_date to today
The task is performed in batches with maximum number of users to send email given in batch_size and the delay between batches is indicated by sleep_time.For each batch a celery task is initiated that sends the email
- Example usage:
$ ./manage.py lms send_verification_expiry_email –batch-size=2000 –sleep-time=5
- OR
$ ./manage.py lms send_verification_expiry_email
- To run the command without sending emails:
$ ./manage.py lms send_verification_expiry_email –dry-run
- add_arguments(parser)#
Entry point for subclassed commands to add custom arguments.
- handle(*args, **options)#
Handler for the command
It creates batches of expired Software Secure Photo Verification and sends it to send_verification_expiry_email that used edx_ace to send email to these learners
- has_valid_manual_verification(user)#
Checks if the user has a valid manual verification
- has_valid_sso_verification(user)#
Checks if the user has a valid sso verification
- help = 'Send email to users for which Software Secure Photo Verification has expired'#
- send_verification_expiry_email(batch_verifications, email_config)#
Sends verification expiry email to the learners in the batch using edx_ace If the email is successfully sent change the expiry_email_date to reflect when the email was sent
- Parameters:
batch_verifications – verification objects for which email will be sent
email_config – Contains configuration like dry-run flag value, which determines whether actual email will be sent or not
- user_has_valid_verification(user)#
Check if the user has a valid sso or manual verification
lms.djangoapps.verify_student.management.commands.trigger_softwaresecurephotoverifications_post_save_signal module#
Django admin command to save SoftwareSecurePhotoVerifications given an iterable of verification_ids, thereby re-emitting the post_save signal.
- class lms.djangoapps.verify_student.management.commands.trigger_softwaresecurephotoverifications_post_save_signal.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommandCommand to save SoftwareSecurePhotoVerification model instances based on a provided interable of verifiction_ids. This re-emits the post_save signal.
- add_arguments(parser)#
Entry point for subclassed commands to add custom arguments.
- handle(*args, **options)#
The actual logic of the command. Subclasses must implement this method.