@requires_badges_enabled
def course_badge_check(user, course_key):
 if (not modulestore().get_course(course_key).issue_badges):
  LOGGER.info('Course is not configured to issue badges.')
  return
 badge_class = get_completion_badge(course_key, user)
 if (not badge_class):
  return
 if BadgeAssertion.objects.filter(user=user, badge_class=badge_class):
  LOGGER.info('Completion badge already exists for this user on this course.')
  return
 evidence = evidence_url(user.id, course_key)
 badge_class.award(user, evidence_url=evidence)

@ requires_badges_enabled def course_badge_check ( user , course_key ) : if ( not modulestore ( ) . get_course ( course_key ) . issue_badges ) : LOGGER . info ( 'Course is not configured to issue badges.' ) return badge_class = get_completion_badge ( course_key , user ) if ( not badge_class ) : return if BadgeAssertion . objects . filter ( user = user , badge_class = badge_class ) : LOGGER . info ( 'Completion badge already exists for this user on this course.' ) return evidence = evidence_url ( user . id , course_key ) badge_class . award ( user , evidence_url = evidence )
takes a generatedcertificate instance .