'Check whether self-generated certificates are enabled for a course.
Arguments:
course_key (CourseKey): The identifier for the course.
Returns:
boolean'

@classmethod
def is_enabled_for_course(cls, course_key):

    try:
        latest = cls.objects.filter(course_key=course_key).latest()
    except cls.DoesNotExist:
        return False
    else:
        return latest.enabled
