Disable audit certificates for new audit enrollments.

An `eligible_for_certificate` field is added to the
GeneratedCertificate model. This way we can retain existing grading
logic, as well as maintaining correctness in analytics and reporting.

Ineligible certificates are hidden by using the
`eligible_certificates` manager on GeneratedCertificate. Some places
in the coe (largely reporting, analytics, and management commands) use
the default `objects` manager, since they need access to all
certificates.

This commit also updates the DB cache for acceptance tests.
This commit is contained in:
Peter Fogg
2016-01-06 12:46:58 -05:00
parent 3d30bb11ab
commit 60860e3aa8
29 changed files with 530 additions and 246 deletions

View File

@@ -185,7 +185,7 @@ def issued_certificates(course_key, features):
report_run_date = datetime.date.today().strftime("%B %d, %Y")
certificate_features = [x for x in CERTIFICATE_FEATURES if x in features]
generated_certificates = list(GeneratedCertificate.objects.filter(
generated_certificates = list(GeneratedCertificate.eligible_certificates.filter(
course_id=course_key,
status=CertificateStatuses.downloadable
).values(*certificate_features).annotate(total_issued_certificate=Count('mode')))