def save(self, *args, **kwargs): # pylint: disable=signature-differs """ After the base save() method finishes, fire the COURSE_CERT_CHANGED signal. If the learner is currently passing the course we also fire the COURSE_CERT_AWARDED signal. The COURSE_CERT_CHANGED signal helps determine if a Course Certificate can be awarded to a learner in the Credentials IDA. The COURSE_CERT_AWARDED signal helps determine if a Program Certificate can be awarded to a learner in the Credentials IDA. """ super().save(*args, **kwargs) COURSE_CERT_CHANGED.send_robust( sender=self.__class__, user=self.user, course_key=self.course_id, mode=self.mode, status=self.status, ) if CertificateStatuses.is_passing_status(self.status): COURSE_CERT_AWARDED.send_robust( sender=self.__class__, user=self.user, course_key=self.course_id, mode=self.mode, status=self.status, )
def send_course_cert_changed_signal(self): COURSE_CERT_CHANGED.send_robust( sender=self.__class__, user=self.generated_certificate.user, course_key=self.generated_certificate.course_id, mode=self.generated_certificate.mode, status=self.generated_certificate.status, )
def save(self, *args, **kwargs): """ After the base save() method finishes, fire the COURSE_CERT_AWARDED signal iff we are saving a record of a learner passing the course. As well as the COURSE_CERT_CHANGED for any save event. """ super(GeneratedCertificate, self).save(*args, **kwargs) COURSE_CERT_CHANGED.send_robust( sender=self.__class__, user=self.user, course_key=self.course_id, mode=self.mode, status=self.status, ) if CertificateStatuses.is_passing_status(self.status): COURSE_CERT_AWARDED.send_robust( sender=self.__class__, user=self.user, course_key=self.course_id, mode=self.mode, status=self.status, )
def save(self, *args, **kwargs): """ After the base save() method finishes, fire the COURSE_CERT_AWARDED signal iff we are saving a record of a learner passing the course. As well as the COURSE_CERT_CHANGED for any save event. """ super(GeneratedCertificate, self).save(*args, **kwargs) COURSE_CERT_CHANGED.send_robust( sender=self.__class__, user=self.user, course_key=self.course_id, mode=self.mode, status=self.status, ) if CertificateStatuses.is_passing_status(self.status): COURSE_CERT_AWARDED.send_robust( sender=self.__class__, user=self.user, course_key=self.course_id, mode=self.mode, status=self.status, )
def save(self, *args, **kwargs): # pylint: disable=signature-differs """ After the base save() method finishes, fire the COURSE_CERT_CHANGED signal. If the learner is currently passing the course we also fire the COURSE_CERT_AWARDED signal. The COURSE_CERT_CHANGED signal helps determine if a Course Certificate can be awarded to a learner in the Credentials IDA. The COURSE_CERT_AWARDED signal helps determine if a Program Certificate can be awarded to a learner in the Credentials IDA. """ super().save(*args, **kwargs) COURSE_CERT_CHANGED.send_robust( sender=self.__class__, user=self.user, course_key=self.course_id, mode=self.mode, status=self.status, ) # .. event_implemented_name: CERTIFICATE_CHANGED CERTIFICATE_CHANGED.send_event(certificate=CertificateData( user=UserData( pii=UserPersonalData( username=self.user.username, email=self.user.email, name=self.user.profile.name, ), id=self.user.id, is_active=self.user.is_active, ), course=CourseData(course_key=self.course_id, ), mode=self.mode, grade=self.grade, current_status=self.status, download_url=self.download_url, name=self.name, )) if CertificateStatuses.is_passing_status(self.status): COURSE_CERT_AWARDED.send_robust( sender=self.__class__, user=self.user, course_key=self.course_id, mode=self.mode, status=self.status, ) # .. event_implemented_name: CERTIFICATE_CREATED CERTIFICATE_CREATED.send_event(certificate=CertificateData( user=UserData( pii=UserPersonalData( username=self.user.username, email=self.user.email, name=self.user.profile.name, ), id=self.user.id, is_active=self.user.is_active, ), course=CourseData(course_key=self.course_id, ), mode=self.mode, grade=self.grade, current_status=self.status, download_url=self.download_url, name=self.name, ))