Only display active users for the certificate report

Also removes the unnecessary pre-fetch.
For certificate generations we will continue to generate certs for
both active and inactive users.

For the report we only display active users since it was confusing
due to the instructor dashboard only displaying active users.
This commit is contained in:
John Jarvis
2014-04-08 13:30:53 -04:00
parent b18a06751c
commit ff8c14e88d
2 changed files with 3 additions and 4 deletions

View File

@@ -61,8 +61,8 @@ class Command(BaseCommand):
# find students who are enrolled
print "Looking up certificate states for {0}".format(course_id)
enrolled_students = User.objects.filter(
courseenrollment__course_id=course_id).prefetch_related(
"groups").order_by('username')
courseenrollment__course_id=course_id,
courseenrollment__is_active=True)
cert_data[course_id] = {'enrolled': enrolled_students.count()}
tallies = GeneratedCertificate.objects.filter(

View File

@@ -84,8 +84,7 @@ class Command(BaseCommand):
print "Fetching enrolled students for {0}".format(course_id)
enrolled_students = User.objects.filter(
courseenrollment__course_id=course_id).prefetch_related(
"groups").order_by('username')
courseenrollment__course_id=course_id)
xq = XQueueCertInterface()
if options['insecure']: