@requires_badges_enabled
def completion_check(user):
 from certificates.models import CertificateStatuses
 config = CourseEventBadgesConfiguration.current().completed_settings
 certificates = user.generatedcertificate_set.filter(status__in=CertificateStatuses.PASSED_STATUSES).count()
 award_badge(config, certificates, user)

@ requires_badges_enabled def completion_check ( user ) : from certificates . models import CertificateStatuses config = CourseEventBadgesConfiguration . current ( ) . completed_settings certificates = user . generatedcertificate_set . filter ( status__in = CertificateStatuses . PASSED_STATUSES ) . count ( ) award_badge ( config , certificates , user )
awards badges based upon the number of courses a user has completed .