Commit e7536da1 by Calen Pennington

Merge pull request #111 from MITx/jarv/ungenerated

Jarv/ungenerated
parents 01a87689 f79884cb
from django.utils.simplejson import dumps
from django.core.management.base import BaseCommand, CommandError
from certificates.models import GeneratedCertificate
class Command(BaseCommand):
help = """
This command finds all GeneratedCertificate objects that do not have a
certificate generated. These come into being when a user requests a
certificate, or when grade_all_students is called (for pre-generating
certificates).
It returns a json formatted list of users and their user ids
"""
def handle(self, *args, **options):
users = GeneratedCertificate.objects.filter(
download_url = None )
user_output = [{'user_id':user.user_id, 'name':user.name}
for user in users]
self.stdout.write(dumps(user_output) + "\n")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment