Filter just downloadable certs for report

This commit is contained in:
Han Su Kim
2014-05-05 13:45:07 -04:00
parent 4b49159205
commit 8bcb70b8bf

View File

@@ -75,8 +75,9 @@ class Command(BaseCommand):
for status in status_tally})
mode_tally = GeneratedCertificate.objects.filter(
course_id__exact=course_id).values('mode').annotate(
dcount=Count('downloadable'))
course_id__exact=course_id,
status__exact='downloadable').values('mode').annotate(
dcount=Count('mode'))
cert_data[course_id].update(
{mode['mode']: mode['dcount']
for mode in mode_tally})