lms.djangoapps.program_enrollments.management.commands package#

Submodules#

lms.djangoapps.program_enrollments.management.commands.expire_waiting_enrollments module#

Management command to cleanup old waiting enrollments

class lms.djangoapps.program_enrollments.management.commands.expire_waiting_enrollments.Command(stdout=None, stderr=None, no_color=False, force_color=False)#

Bases: BaseCommand

Deletes enrollments not tied to a user that have not been modified for at least 60 days.

Example usage:

$ ./manage.py lms expire_waiting_enrollments

WAITING_ENROLLMENTS_EXPIRATION_DAYS = 60#
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 = 'Remove expired enrollments that have not been linked to a user.'#

lms.djangoapps.program_enrollments.management.commands.migrate_saml_uids module#

Management command to re-write UIDs identifying learners in external organizations’ systems

Intented for use in production environments, to help support migration of existing SSO learners into our most-recent program enrollment flow without needing to manually re-link their account.

class lms.djangoapps.program_enrollments.management.commands.migrate_saml_uids.Command(stdout=None, stderr=None, no_color=False, force_color=False)#

Bases: BaseCommand

Updates UserSocialAuth records to use UIDs provided in the supplied JSON file

Example usage:
$ ./manage.py lms migrate_saml_uids.py –uid-mapping=path/to/file.json

–saml-provider-slug=default

add_arguments(parser)#

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)#

Performs the re-writing

help = 'Updates UserSocialAuth records to use UIDs provided in the supplied JSON file\n\nExample usage:\n    $ ./manage.py lms migrate_saml_uids.py           --uid-mapping=path/to/file.json\n      --saml-provider-slug=default'#

lms.djangoapps.program_enrollments.management.commands.reset_enrollment_data module#

Management command to remove enrollments and any related models created as a side effect of enrolling students.

Intented for use in integration sandbox environments

class lms.djangoapps.program_enrollments.management.commands.reset_enrollment_data.Command(stdout=None, stderr=None, no_color=False, force_color=False)#

Bases: BaseCommand

Deletes all enrollments and related data

Example usage:

$ ./manage.py lms reset_enrollment_data ca73b4af-676a-4bb3-a9a5-f6b5a3dedd,1c5f61b9-0be5-4a90-9ea5-582d5e066c

add_arguments(parser)#

Entry point for subclassed commands to add custom arguments.

confirmation_prompt = "Type 'confirm' to continue with deletion\n"#
handle(*args, **options)#

The actual logic of the command. Subclasses must implement this method.

help = 'Deletes all enrollments and related data\n\nExample usage:\n    $ ./manage.py lms reset_enrollment_data ca73b4af-676a-4bb3-a9a5-f6b5a3dedd,1c5f61b9-0be5-4a90-9ea5-582d5e066c'#

lms.djangoapps.program_enrollments.management.commands.send_program_course_nudge_email module#

Django management command for sending nudge emails to learners after they complete once course in a program, to suggest to complete possible next course from same program.

class lms.djangoapps.program_enrollments.management.commands.send_program_course_nudge_email.Command(stdout=None, stderr=None, no_color=False, force_color=False)#

Bases: BaseCommand

Django management command for sending nudge emails to learners

This command sends nudge emails to complete next course to learners after they complete a course that is linked with one or multiple programs. if next course in the program is already in progress, command skips that program and try to propose course for next linked program.

Example usage:

$ ./manage.py lms send_program_course_nudge_email $ ./manage.py lms send_program_course_nudge_email –no-commit

add_arguments(parser)#

Entry point to add arguments.

emit_event(user, program, suggested_course_run, suggested_course, completed_course_run)#

Emit the Segment event which will be used by Braze to send the email

find_detailed_program(programs, program_progress)#

get detailed program.

static get_candidate_program_and_courses(program, program_progress)#

Get program in a new format containing candidate_courses and in_progress_courses_ids

get_candidate_programs(programs, programs_progress)#

Get all programs with candidate courses.

get_course_run(program, course_run_id)#

get course run from a program.

get_course_run_to_suggest(candidate_programs, completed_course_id, user)#

Finds out enrollable course run from programs Generated by ProgramProgressMeter.

Returns: Suggested program and course_run dicts

get_passed_course_to_users_maps()#

Returns mapping between course passed yesterday with passing users.

handle(*args, **options)#

Command’s entry point.

sort_programs(programs)#

Sorts programs based on their revenue ranking.

valid_course_run(course_run)#

Check if a course run is in enrollable state.

Module contents#