enterprise.management.commands package

Submodules

enterprise.management.commands.backfill_learner_role_assignments module

Management command for assigning enterprise_learner roles to existing linked enterprise users that are missing them.

class enterprise.management.commands.backfill_learner_role_assignments.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Management command for assigning enterprise_learner roles to existing enterprise users.

Example usage:

$ ./manage.py backfill_learner_role_assignments

add_arguments(parser)

Entry point for subclassed commands to add custom arguments.

backfill_learner_role_assignments(options)

Assigns enterprise_learner role to users.

handle(*args, **options)

Entry point for management command execution.

help = 'Assigns enterprise_learner role to linked enterprise users missing them.'

enterprise.management.commands.bulk_update_catalog_query_id module

Django management command for bulk updating EnterpriseCustomerCatalog record’s EnterpriseCatalogQuery’s.

class enterprise.management.commands.bulk_update_catalog_query_id.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Takes a new and old Enterprise Catalog Query ID, find all most recent records within the historical Enterprise Catalog table where enterprise catalog query ID is the old ID provided and updates the corresponding Enterprise Catalog table entries with the new ID.

add_arguments(parser)

Entry point for subclassed commands to add custom arguments.

get_args_from_database()

Returns an options dictionary from the current BulkCatalogQueryUpdateCommandConfiguration model.

handle(*args, **options)

Entry point for management command execution.

help = "Updates specified EnterpriseCatalog's enterprise catalog query ID records with a provided new ID"

enterprise.management.commands.create_enterprise_course_enrollments module

Django management command for creating EnterpriseCourseEnrollment records.

class enterprise.management.commands.create_enterprise_course_enrollments.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Creates EnterpriseCourseEnrollment records (if they do not already exist) for CourseEnrollment records that are associated with an enterprise user and a course run that exists in the enterprise’s catalog.

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 = 'Create EnterpriseCourseEnrollment records for CourseEnrollment records associated with an enterprise.'

enterprise.management.commands.create_missing_dsc_records module

Django management command for creating DataSharingConsent records.

class enterprise.management.commands.create_missing_dsc_records.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Django management command for creating DataSharingConsent records

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.

enterprise.management.commands.email_drip_for_missing_dsc_records module

Django management command for sending an email to learners with missing DataSharingConsent records.

class enterprise.management.commands.email_drip_for_missing_dsc_records.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Django management command for sending an email to learners with missing DataSharingConsent records

add_arguments(parser)

Entry point for subclassed commands to add custom arguments.

emit_event(ec_user, course_id, enterprise_customer, greeting_name)

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

get_enterprise_course_enrollments(options)

Get EnterpriseCourseEnrollment records according to the options and with dsc enabled

handle(*args, **options)

Management command for sending an email to learners with a missing DSC. Designed to run daily.

Example usage:

$ ./manage.py email_drip_for_missing_dsc_records $ ./manage.py email_drip_for_missing_dsc_records –no-commit $ ./manage.py email_drip_for_missing_dsc_records –enrollment-before 2021-05-06 –no-commit $ ./manage.py email_drip_for_missing_dsc_records –enrollment-before 2021-05-06

enterprise.management.commands.ensure_singular_active_enterprise_customer_user module

Django management command to ensure there is at most a single EnterpriseCustomerUser with active=True for each enterprise user.

class enterprise.management.commands.ensure_singular_active_enterprise_customer_user.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Django management command to ensure there is at most a single EnterpriseCustomerUser with active=True for each enterprise user.

Example usage: ./manage.py lms ensure_singular_active_enterprise_customer_user

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.

enterprise.management.commands.fix_dsc_records module

Django management command to Fix DSC records having spaces in there course Id.

class enterprise.management.commands.fix_dsc_records.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Django management command to Fix DSC records having spaces in there course Id.

This Command fixes the DSC records what were saved due to bug in our system and DSC records were saved with spaces.

Example usage: ./manage.py lms fix_dsc_records ./manage.py lms fix_dsc_records –no-commit

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.

enterprise.management.commands.migrate_enterprise_catalogs module

Django management command for migrating EnterpriseCustomerCatalog data to new service.

class enterprise.management.commands.migrate_enterprise_catalogs.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Migrate EnterpriseCustomerCatalog data to new Enterprise Catalog service.

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 = 'Migrate EnterpriseCustomerCatalog data to new Enterprise Catalog service.'

enterprise.management.commands.monthly_impact_report module

Django management command to send monthly impact report to enterprise admins.

class enterprise.management.commands.monthly_impact_report.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Django management command to send monthly impact report to enterprise admins.

Example usage: ./manage.py lms monthly_impact_report ./manage.py lms monthly_impact_report –no-commit

add_arguments(parser)

Entry point for subclassed commands to add custom arguments.

emit_event(**kwargs)

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

get_query_results_from_snowflake()

Get query results from Snowflake and yield each row.

handle(*args, **options)

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

enterprise.management.commands.nudge_dormant_enrolled_enterprise_learners module

Django management command to send nudge email to dormant enrolled enterprise learners.

class enterprise.management.commands.nudge_dormant_enrolled_enterprise_learners.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Django management command to send nudge email to dormant enrolled enterprise learners.

Example usage: ./manage.py lms nudge_dormant_enrolled_enterprise_learners ./manage.py lms nudge_dormant_enrolled_enterprise_learners –no-commit

add_arguments(parser)

Entry point for subclassed commands to add custom arguments.

emit_event(**kwargs)

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

get_query_results_from_snowflake()

Get query results from Snowflake and yield each row.

handle(*args, **options)

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

enterprise.management.commands.revert_enrollment_objects module

Management command for reverting revoked enrollment related objects to a particular time.

class enterprise.management.commands.revert_enrollment_objects.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Management command for reverting revoked enrollment related objects to a particular time.

Example usage:

$ ./manage.py revert_enrollment_objects –year 2021 –month 11 –day 17 –enterprise-customer-name test-co

add_arguments(parser)

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)

Entry point for management command execution.

help = 'Reverts revoked enrollment related objects to a particular time.'
revert_enrollment_objects(options)

Revert all EnterpriseCourseEnrollment, LicensedEnterpriseCourseEnrollment, and “student” CourseEnrollment objects to the date provided, using the history table IF is_revoked = True on LicensedEnterpriseCourseEnrollment

enterprise.management.commands.save_enterprise_customer_users module

Django management command for saving EnterpriseCustomerUser models.

class enterprise.management.commands.save_enterprise_customer_users.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Calls save() on EnterpriseCustomerUser models.

This is useful for triggering save-related signals causing the associated signal receiver functions to fire.

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 = 'Save existing EnterpriseCustomerUser models.'

enterprise.management.commands.seed_enterprise_devstack_data module

Management command for assigning enterprise roles to existing enterprise users.

class enterprise.management.commands.seed_enterprise_devstack_data.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Management command for populating Devstack with initial data for enterprise.

Example usage:

$ ./manage.py lms seed_enterprise_devstack_data

add_arguments(parser)

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)

Entry point for managment command execution.

help = '\n    Seeds an enterprise customer, users of various roles and permissions initial\n    data in devstack for related Enterprise models.\n    '

enterprise.management.commands.update_role_assignments_with_customers module

Management command for updating enterprise user role assignments with appropriate enterprise_customer and applies_to_all_contexts values.

class enterprise.management.commands.update_role_assignments_with_customers.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

Management command for creating enterprise role assignments with a foreign key to an EnterpriseCustomer, or an explicit boolean flag indicating that the assignment grants the role to the user for every EnterpriseCustomer.

add_arguments(parser)

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)

Entry point for managment command execution.

help = '\n    Applies explicit enterprise customer context for enterprise admin, learner, and catalog system role assignments.\n    It also sets `applies_to_all_contexts` to true for assignments of the `enterprise_openedx_operator` role.\n    Example usage:\n      # Do a dry run for admin assignments of some customer\n      ./manage.py lms update_role_assignments_with_customers --role=enterprise_admin --dry-run --enterprise-customer-uuid=00000000-1111-2222-3333-444444444444\n      # Do a real run for all operators\n      ./manage.py lms update_role_assignments_with_customers --role=enterprise_openedx_operator\n      # Process everything for everyone\n      ./manage.py lms update_role_assignments_with_customers\n    '

Module contents