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:
@@ -1584,7 +1584,7 @@ def invalidate_generated_certificates(course_id, enrolled_students, certificate_
|
||||
:param enrolled_students: (queryset or list) students enrolled in the course
|
||||
:param certificate_statuses: certificates statuses for whom to remove generated certificate
|
||||
"""
|
||||
certificates = GeneratedCertificate.objects.filter(
|
||||
certificates = GeneratedCertificate.objects.filter( # pylint: disable=no-member
|
||||
user__in=enrolled_students,
|
||||
course_id=course_id,
|
||||
status__in=certificate_statuses,
|
||||
|
||||
@@ -1802,7 +1802,7 @@ class TestCertificateGeneration(InstructorTaskModuleTestCase):
|
||||
},
|
||||
result
|
||||
)
|
||||
generated_certificates = GeneratedCertificate.objects.filter(
|
||||
generated_certificates = GeneratedCertificate.eligible_certificates.filter(
|
||||
user__in=students,
|
||||
course_id=self.course.id,
|
||||
mode='honor'
|
||||
@@ -1912,7 +1912,7 @@ class TestCertificateGeneration(InstructorTaskModuleTestCase):
|
||||
result
|
||||
)
|
||||
|
||||
generated_certificates = GeneratedCertificate.objects.filter(
|
||||
generated_certificates = GeneratedCertificate.eligible_certificates.filter(
|
||||
user__in=students,
|
||||
course_id=self.course.id,
|
||||
mode='honor'
|
||||
|
||||
Reference in New Issue
Block a user