'Check that whether the student in the course has been invalidated
for receiving certificates.
Arguments:
student (user): logged-in user
course_key (CourseKey): The course associated with the certificate.
Returns:
Boolean denoting whether the student in the course is invalidated
to receive certificates'

@classmethod
def has_certificate_invalidation(cls, student, course_key):

    return cls.objects.filter(generated_certificate__course_id=course_key, active=True, generated_certificate__user=student).exists()
