EDUCATOR-1241 | make a separate file to make decisions about auto generated certs.
This commit is contained in:
committed by
Alex Dusenbery
parent
29f6d5d610
commit
0137e38e97
@@ -16,7 +16,7 @@ from pytz import timezone, utc
|
||||
from course_modes.models import CourseMode
|
||||
from lms.djangoapps.commerce.utils import EcommerceService
|
||||
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification, VerificationDeadline
|
||||
from openedx.core.djangoapps.certificates.config import waffle
|
||||
from openedx.core.djangoapps.certificates.api import can_show_certificate_available_date_field
|
||||
from student.models import CourseEnrollment
|
||||
|
||||
|
||||
@@ -198,8 +198,8 @@ class CourseEndDate(DateSummary):
|
||||
|
||||
class CertificateAvailableDate(DateSummary):
|
||||
"""
|
||||
Displays the end date of the course.
|
||||
"""
|
||||
Displays the certificate available date of the course.
|
||||
"""
|
||||
css_class = 'certificate-available-date'
|
||||
title = ugettext_lazy('Certificate Available')
|
||||
|
||||
@@ -213,10 +213,9 @@ class CertificateAvailableDate(DateSummary):
|
||||
@property
|
||||
def is_enabled(self):
|
||||
return (
|
||||
can_show_certificate_available_date_field(self.course) and
|
||||
self.date is not None and
|
||||
datetime.datetime.now(utc) <= self.date and
|
||||
not self.course.self_paced and
|
||||
waffle.waffle().is_enabled(waffle.INSTRUCTOR_PACED_ONLY) and
|
||||
len(self.active_certificates) > 0
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user