From 8bcb70b8bf3a84d6053db59d634a8ca85eba0e2b Mon Sep 17 00:00:00 2001 From: Han Su Kim Date: Mon, 5 May 2014 13:45:07 -0400 Subject: [PATCH] Filter just downloadable certs for report --- .../certificates/management/commands/gen_cert_report.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/certificates/management/commands/gen_cert_report.py b/lms/djangoapps/certificates/management/commands/gen_cert_report.py index b12da62831..54b30ca275 100644 --- a/lms/djangoapps/certificates/management/commands/gen_cert_report.py +++ b/lms/djangoapps/certificates/management/commands/gen_cert_report.py @@ -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})