lms.djangoapps.certificates.management.commands package#

Submodules#

lms.djangoapps.certificates.management.commands.cert_generation module#

Management command to generate course certificates for one or more users in a given course run.

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

Bases: BaseCommand

Management command to generate course certificates for one or more users in a given course run.

Example usage: ./manage.py lms cert_generation -u 123 456 -c course-v1:edX+DemoX+Demo_Course

add_arguments(parser)#

Entry point for subclassed commands to add custom arguments.

get_args_from_database()#

Returns an options dictionary from the current CertificateGenerationCommandConfiguration model.

handle(*args, **options)#

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

help = '\n    Generate course certificates for one or more users in a given course run.\n    '#

lms.djangoapps.certificates.management.commands.modify_cert_template module#

Management command to modify certificate templates.

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

Bases: BaseCommand

Management command to modify certificate templates. Example usage: ./manage.py lms modify_cert_template –old-text “</head>” –new text “<p>boo!</p></head>” –templates 867 3509

add_arguments(parser)#

Entry point for subclassed commands to add custom arguments.

get_args_from_database()#

Returns an options dictionary from the current ModifiedCertificateTemplateCommandConfiguration instance.

handle(*args, **options)#

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

help = "Modify one or more certificate templates.\n    This is DANGEROUS.\n    * This uses string replacement to modify HTML-like templates, because the presence of\n      Django Templating makes it impossible to do true parsing.\n    * This isn't parameterizing the replacement text, for the same reason.  It has\n      no way of knowing what is template language and what is HTML.\n    Do not trust that this will get the conversion right without verification,\n    and absolutely do not accepted untrusted user input for the replacement text. This is\n    to be run by trusted users only.\n    Always run this with dry-run or in a reliable test environment.\n    "#

lms.djangoapps.certificates.management.commands.purge_pii_from_generatedcertificates module#

A management command, designed to be run once by Open edX Operators, to obfuscate learner PII from the Certificates_GeneratedCertificate table that should have been purged during learner retirement.

A fix has been included in the retirement pipeline to properly purge this data during learner retirement. This can be used to purge PII from accounts that have already been retired.

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

Bases: BaseCommand

This management command performs a bulk update on GeneratedCertificate instances. This means that it will not invoke the custom save() function defined as part of the GeneratedCertificate model, and thus will not emit any Django signals throughout the system after the update occurs. This is desired behavior. We are using this management command to purge remnant PII, retired elsewhere in the system, that should have already been removed from the Certificates tables. We don’t need updates to propogate to external systems (like the Credentials IDA).

This management command functions by requesting a list of learners’ user_ids whom have completed their journey through the retirement pipeline. The get_retired_user_ids utility function is responsible for filtering out any learners in the PENDING state, as they could still submit a request to cancel their account deletion request (and we don’t want to remove any data that may still be good).

Example usage:

# Dry Run (preview changes): $ ./manage.py lms purge_pii_from_generatedcertificates –dry-run

# Purge data: $ ./manage.py lms purge_pii_from_generatedcertificates

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 = "\n    Purges learners' full names from the `Certificates_GeneratedCertificate` table if their account has been\n    successfully retired.\n    "#

lms.djangoapps.certificates.management.commands.purge_references_to_pdf_certificates module#

A management command designed to be part of the retirement pipeline for any Open EdX operators with users who still have legacy PDF certificates.

Once an external process has run to remove the four files comprising a legacy PDF certificate, this management command will remove the reference to the file from the certificate record.

Note: it is important to retain the reference in the certificate table until the files have been deleted, because that reference is the files’ identifying descriptor.

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

Bases: BaseCommand

Doesn’t invoke the custom save() function defined as part of the GeneratedCertificate model; perforce will emit no Django signals. This is desired behavior. We are using this management command to purge information that was never sent to any other systems, so we don’t need to propagate updates.

Example usage:

# Dry Run (preview changes): $ ./manage.py lms purge_references_to_pdf_certificates –dry-run

# Purge data: $ ./manage.py lms purge_references_to_pdf_certificates

add_arguments(parser)#

Entry point for subclassed commands to add custom arguments.

get_args_from_database()#

Returns an options dictionary from the current CertificateGenerationCommandConfiguration model.

handle(*args, **options)#

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

help = 'Purges references to PDF certificates. Intended to be run after the files have been deleted.'#

lms.djangoapps.certificates.management.commands.regenerate_noidv_cert module#

Management command to regenerate unverified certificates when a course transitions to honor code.

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

Bases: BaseCommand

Management command to regenerate unverified certificates when a course transitions to honor code.

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.

Module contents#